-
Notifications
You must be signed in to change notification settings - Fork 128
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5283 +/- ##
=======================================
Coverage 84.39% 84.39%
=======================================
Files 140 140
Lines 58645 58684 +39
=======================================
+ Hits 49493 49528 +35
- Misses 9152 9156 +4 |
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 :) |
…ges. All elements now support names that are Strings, Integers, Floats or left blank as per expected Maxwell circuit schematic usage.
I went through |
Yes!, 'GetNumPages', how did I miss that, Thanks |
Hi @DaveTwyman, could you please add the last changes required for this PR ? :) |
Yes, I'm planning to get back to finish that shortly
…________________________________
From: Sébastien Morais ***@***.***>
Sent: Tuesday, October 29, 2024 10:45
To: ansys/pyaedt ***@***.***>
Cc: David Twyman ***@***.***>; Mention ***@***.***>
Subject: Re: [ansys/pyaedt] FEAT: VSin, ISin Sources added to Maxwell Circuit Primitives (PR #5283)
[External Sender]
Hi @DaveTwyman<https://github.com/DaveTwyman>, could you please add the last changes required for this PR ? :)
—
Reply to this email directly, view it on GitHub<#5283 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVVIYTCE36KV4RDR3OZAJQDZ55RNJAVCNFSM6AAAAABPYVZE36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBTHA3DMNBZGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hello @SMoraisAnsys , I've added the last unit test, and method needed to support that test (plus another unit test for the new method). So all the new methods now have supporting unit tests. It seems that the test coverage codecov is very low, do you think this is because of making multiple single line changes 'id' to 'component' or issues elsewhere? |
Try to run your test locally and see if it is correctly covered. It might be a codecov issue (but I doubt about it). |
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 please review and fix all the comments.
You created unit tests that don't run at all. Please test, run and debug locally before pushing commits to your PR.
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
Co-authored-by: gmalinve <[email protected]>
Co-authored-by: gmalinve <[email protected]>
Co-authored-by: gmalinve <[email protected]>
Co-authored-by: gmalinve <[email protected]>
Co-authored-by: gmalinve <[email protected]>
…uld not be in circuit.py. -Replaced set_property method with parameter method. -Added example in docstring for create_i_sin and create_v_sin. -Added more checks for create_voltage_source and create_current_source name types in unit tests. -Moved create_page and get_num_pages unit tests to test_35_MaxwellCircuit.py -Added assert not to two of the unit tests
…Missing-Circuit-Elements
# Conflicts: # tests/system/general/test_21_Circuit.py
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.
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.
self.oeditor.CreatePage(name) | ||
return True | ||
|
||
def get_num_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.
I think it would be better to add nb_pages
as a property instead of adding this feature as a method.
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.
@SMoraisAnsys , That would be a better implementation. I'll make that switch to a parameter
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.
Hello @SMoraisAnsys
Can I double check my planned implementation is the same as your suggestion.
This change would mean 'get_num_pages' would be accessed as an attribute of the MaxwellCircuit class?
self.oeditor.CreatePage(name) | ||
return True | ||
|
||
def get_num_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.
I think it would be better to add nb_pages
as a property instead of adding this feature as a method.
assert self.aedtapp.create_page(3.14) == True | ||
assert not self.aedtapp.create_page(["create_page_test"]) | ||
|
||
def test_12_get_num_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.
Could you please add a test on the return value and not only on the value type ?
Create Page and Select Page added to Circuit Primitives