Skip to content
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

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

DaveTwyman
Copy link
Contributor

Create Page and Select Page added to Circuit Primitives

Create Page and Select Page added to Circuit Primitives
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@DaveTwyman DaveTwyman changed the title VSin, ISin Sources added to Maxwell Circuit Primitives FEAT: VSin, ISin Sources added to Maxwell Circuit Primitives Oct 11, 2024
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.01%. Comparing base (4ab7475) to head (70600ea).
Report is 3 commits behind head on main.

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     

DaveTwyman and others added 4 commits October 11, 2024 13:04
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
@gmalinve gmalinve marked this pull request as draft October 11, 2024 12:53
Copy link
Collaborator

@SMoraisAnsys SMoraisAnsys left a 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 ?

@gmalinve
Copy link
Contributor

gmalinve commented Oct 14, 2024

@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:
image
This package will automatically run all the checks specified in .pre-commit-config.yaml when you push a commit.

Also remember to update and merge main in your branch from time to time.

@DaveTwyman
Copy link
Contributor Author

@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: image This package will automatically run all the checks specified in .pre-commit-config.yaml when you push a 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 DaveTwyman marked this pull request as ready for review October 14, 2024 10:47
@SMoraisAnsys
Copy link
Collaborator

@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.

@DaveTwyman
Copy link
Contributor Author

@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

@gmalinve
Copy link
Contributor

@DaveTwyman you need to add unit tests now :)

@gmalinve gmalinve marked this pull request as draft October 16, 2024 15:00
@DaveTwyman DaveTwyman marked this pull request as ready for review October 17, 2024 09:57
@DaveTwyman DaveTwyman enabled auto-merge (squash) November 13, 2024 09:04
@DaveTwyman DaveTwyman self-assigned this Nov 13, 2024
Copy link
Collaborator

@SMoraisAnsys SMoraisAnsys left a 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.

src/ansys/aedt/core/maxwellcircuit.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/modeler/circuits/primitives_circuit.py Outdated Show resolved Hide resolved
tests/system/general/test_35_MaxwellCircuit.py Outdated Show resolved Hide resolved
DaveTwyman and others added 5 commits November 19, 2024 15:45
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.
@SMoraisAnsys
Copy link
Collaborator

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 ?
About the pages features, can you add a test to create_page on CircuitComponents class ? Also, would it make sense to add nb_pages to this class ?

@gmalinve gmalinve requested review from anur7 and removed request for Samuelopez-ansys and SMoraisAnsys November 25, 2024 08:37
src/ansys/aedt/core/circuit.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/modeler/circuits/primitives_circuit.py Outdated Show resolved Hide resolved
tests/system/general/test_35_MaxwellCircuit.py Outdated Show resolved Hide resolved
tests/system/general/test_35_MaxwellCircuit.py Outdated Show resolved Hide resolved
DaveTwyman and others added 3 commits December 4, 2024 11:57
…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
@DaveTwyman
Copy link
Contributor Author

@gmalinve, @SMoraisAnsys , I've made all the requested changes to this PR.
Can you let me know what is now needed to merge it to the main.
All checks have passed apart from 2skipped (Release Project and Upload Release Documentation)

I've just pressed the Update branch button as this branch was not out of date

Thanks

@DaveTwyman
Copy link
Contributor Author

@gmalinve, @SMoraisAnsys , I've made all the requested changes to this PR. Can you let me know what is now needed to merge it to the main. All checks have passed apart from 2skipped (Release Project and Upload Release Documentation)

I've just pressed the Update branch button as this branch was not out of date

Thanks

@gmalinve, @SMoraisAnsys
As per this mornings Office Hours call, creation of a new class in the Schematic.py would be needed to keep track of the page number. I've added this work to this PR

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"])
Copy link
Contributor

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.

Copy link
Contributor Author

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):
Copy link
Collaborator

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)):
Copy link
Collaborator

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 ?

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.

Add Missing Circuit Elements Needed for ETK
4 participants