-
Notifications
You must be signed in to change notification settings - Fork 164
Adding Process ID so PyAEDT can point to a specific instance of Electronics Desktop #1187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…T, running from CPython 3.x, at a specific instance of Electronics Desktop. Only implemented and tested for the Hfss class and parent classes. The parameter is optional and does not modify the behavior of previous examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extend the aedt_process_id to all AEDT apps
pyaedt/hfss.py
Outdated
aedt_process_id : int, optional | ||
Only used when new_desktop_session == False, specifies by process id which instance | ||
of electronics desktop to point PyAEDT at. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@camuher I like this approach. Anyway you should add the aedt_process_id to any of the tools (q2d, q3d, maxwell3d etc...) otherwise you will be able to initialize the app using process id only from Hfss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxcapodi78 thank you for the quick reply. As specified in my latest commit I've added it to almost all the tools(and parent classes as needed) which makes for a uniform variable across the board. The only one I couldn't add it to was siwave whose init differs significantly from the structure used by the other tools. I hope this is sufficient to address your request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@camuher
you have to ignore siwave
it is different approach.
Please merge from main to get a fix on UT and then I can approve the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxcapodi78 I've merged to be up to date with main now. I also addressed the error that caused the UT for rmxport and twinbuilder to fail. I hadn't added the variable to their parent classes. There were also miscellaneous edits to make the code more uniform with the style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@camuher I still see some style error. I suggest to install pre-commit on your environment.
pip install pre-commit
pre-commit install
It will automatically fix style errors on commit.
PS can you ping me on Teams? I'd like to know who you are :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyaedt/application/Analysis.py
Outdated
@@ -69,6 +69,9 @@ class Analysis(Design, object): | |||
Whether to release AEDT on exit. | |||
student_version : bool | |||
Whether to enable the student version of AEDT. | |||
aedt_process_id : int, optional | |||
Only used when new_desktop_session == False, specifies by process id which instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only used when new_desktop_session == False, specifies by process id which instance | |
Only used when new_desktop_session = False, specifies by process id which instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaxJPRey in my latest commit i've followed this style while addressing Massimo's comment.
…l3d, maxwell2d, maxwellcircuit, mechanical, Qextractor, q3d, q2d, rmxprt, twinbuilder and their parent classes for uniformity.
…winbuilder parent classes which was overlooked in the previous commit, causing build failures.
Codecov Report
@@ Coverage Diff @@
## main #1187 +/- ##
=======================================
Coverage 80.97% 80.97%
=======================================
Files 135 135
Lines 44376 44380 +4
=======================================
+ Hits 35932 35937 +5
+ Misses 8444 8443 -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Improvement
@@ -363,7 +368,12 @@ def __init__( | |||
if StrictVersion(version_key) < StrictVersion("2022.2.0") or not settings.use_grpc_api: | |||
print("Launching PyAEDT outside Electronics Desktop with CPython and Pythonnet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print("Launching PyAEDT outside Electronics Desktop with CPython and Pythonnet") | |
print("Launching PyAEDT outside Electronics Desktop with CPython and Python.Net.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @PipKat , while I don't mind committing the small change to this print statement, it is outside the scope of changes I contributed to the code. I'd appreciate the (somewhat redundant) affirmation that it is ok to proceed with this commit.
pyaedt/application/Design.py
Outdated
Only used when new_desktop_session = False, specifies by process id which instance | ||
of electronics desktop to point PyAEDT at. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only used when new_desktop_session = False, specifies by process id which instance | |
of electronics desktop to point PyAEDT at. | |
Only used when ``new_desktop_session = False``, specifies by process ID which instance | |
of Electronics Desktop to point PyAEDT at. |
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
The capability is meant to facilitate the use of a launcher(not part of the pull request) from within Electronics Desktop to launch a PyAEDT script that can access all the external libraries available to an installation of CPython while retaining a reference to the instance of Electronics desktop that launched it.