-
Notifications
You must be signed in to change notification settings - Fork 134
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
FEAT: VSin, ISin Sources added to Maxwell Circuit Primitives #5283
base: main
Are you sure you want to change the base?
Conversation
Create Page and Select Page added to Circuit Primitives
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5283 +/- ##
=======================================
Coverage 85.00% 85.01%
=======================================
Files 151 151
Lines 60761 60794 +33
=======================================
+ Hits 51652 51684 +32
- Misses 9109 9110 +1 |
Create Page and Select Page added to Circuit Primitives
…s' into 5282-Add-Missing-Circuit-Elements # Conflicts: # src/ansys/aedt/core/modeler/circuits/primitives_circuit.py
Create Page and Select Page added to Circuit Primitives
for more information, see https://pre-commit.ci
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.
Thanks for the changes, could you address the comments and add tests ?
src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py
Outdated
Show resolved
Hide resolved
src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py
Outdated
Show resolved
Hide resolved
src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py
Outdated
Show resolved
Hide resolved
src/ansys/aedt/core/modeler/circuits/primitives_maxwell_circuit.py
Outdated
Show resolved
Hide resolved
Create Page added to Circuit Primitives
for more information, see https://pre-commit.ci
@DaveTwyman please install pre-commit in your venv because I see that every time you push a commit it automatically triggers the auto fixes pre-commit: Also remember to update and merge main in your branch from time to time. |
@gmalinve Good point about the pre-commit, I see it's installed on my machine. I've just updated it too. I guess the issue is I need to start using it before each push. I believe I'm updating main before each push from PyCharm, but let me know if you can see evidence something is wrong here. Thanks again as always |
@DaveTwyman If it is installed on your machine then it shouldn't let you commit. The precommit should trigger the problems locally before allowing you to make any commit. |
Ok, understood, I'm just reading up on how to set this up now |
@DaveTwyman you need to add unit tests now :) |
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.
I think it would be better to add the get number pages feature as a property, could you update the code ?
Also, the added code in primitives_circuit.py
is not tested, could you test it ?
I left an extra minor comment.
Unit test 12 no longer needed. Added nb_pages after each page is created in unit test 11 to catch cases where pages are not created.
…ed 'nb_pages'. Change made for circuit so implementation is the same as maxwellcircuit.
Hey @DaveTwyman, I'm not sure about the status of this PR. Do you want to add VSin and ISin on top of the pages features or should this be splited into two PRs and some commits got added inadvertently ? |
…ng located in maxwellcircuit.py, circuit.py and primitives_circuit.py -Added @pyaedt_function_handler() where missing in three new methods and property. -Removed unused variables from test_25 in test_21_Circuit.py -Removed self. from component in test_09 and test_10 of test_35_MaxwellCircuit.py
@gmalinve, @SMoraisAnsys , I've made all the requested changes to this PR. I've just pressed the Update branch button as this branch was not out of date Thanks |
@gmalinve, @SMoraisAnsys |
assert self.aedtapp.modeler.nb_pages == 3 | ||
assert self.aedtapp.modeler.create_page(3.14) | ||
assert self.aedtapp.modeler.nb_pages == 4 | ||
assert not self.aedtapp.modeler.create_page(["create_page_test"]) |
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.
@DaveTwyman is there any reason why are you testing create_page giving as argument different type of data types? I think the code lines 134 and 140 are enough to test create_page.
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.
@anur7 , The other lines are there to test that passing other data types works correctly. As there is no AEDT documentation on page name data types, we've restricted it to String, Integer and Float and just test these types.
return True | ||
|
||
@property | ||
def nb_pages(self): |
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.
This is not tested, could you add a test ?
id.set_property("Name", name) | ||
return id | ||
component.set_property("R", value) | ||
if isinstance(name, (str, int, float)): |
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.
Just wondering, why is this change required ? Was id.set_property("Name", name)
not working as expected ?
Create Page and Select Page added to Circuit Primitives