Skip to content

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

Merged
merged 29 commits into from
May 20, 2022

Conversation

camuher
Copy link
Contributor

@camuher camuher commented May 16, 2022

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.

camuher added 2 commits May 16, 2022 17:28
…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.
Copy link
Collaborator

@maxcapodi78 maxcapodi78 left a 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
Comment on lines 75 to 77
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.
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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 :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this last commit should correct the remaining edits and (if I'm interpreting the output correctly on the pre-commit) passes the style check
image

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor Author

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.

camuher and others added 4 commits May 17, 2022 10:35
…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
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #1187 (c125bf8) into main (20b47c2) will increase coverage by 0.00%.
The diff coverage is 87.50%.

@@           Coverage Diff           @@
##             main    #1187   +/-   ##
=======================================
  Coverage   80.97%   80.97%           
=======================================
  Files         135      135           
  Lines       44376    44380    +4     
=======================================
+ Hits        35932    35937    +5     
+ Misses       8444     8443    -1     

Copy link
Collaborator

@maxcapodi78 maxcapodi78 left a 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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Launching PyAEDT outside Electronics Desktop with CPython and Pythonnet")
print("Launching PyAEDT outside Electronics Desktop with CPython and Python.Net.")

Copy link
Contributor Author

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.

Comment on lines 312 to 313
Only used when new_desktop_session = False, specifies by process id which instance
of electronics desktop to point PyAEDT at.
Copy link
Member

@PipKat PipKat May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

camuher and others added 20 commits May 19, 2022 15:08
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]>
@maxcapodi78 maxcapodi78 merged commit 270a5d3 into ansys:main May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants