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 38 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

Attention: Patch coverage is 89.47368% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.32%. Comparing base (8717418) to head (9f129ad).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5283      +/-   ##
==========================================
- Coverage   84.59%   83.32%   -1.28%     
==========================================
  Files         142      142              
  Lines       59941    59980      +39     
==========================================
- Hits        50710    49980     -730     
- Misses       9231    10000     +769     
---- 🚨 Try these New Features:

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 marked this pull request as ready for review October 30, 2024 21:03
@DaveTwyman
Copy link
Contributor Author

Hi @DaveTwyman, could you please add the last changes required for this PR ? :)

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?
image

@SMoraisAnsys
Copy link
Collaborator

Try to run your test locally and see if it is correctly covered. It might be a codecov issue (but I doubt about it).
It might be because you are not really going through the lines you expect to go through.
I can't have a look at your PR now and giving general advice so that you can check where the coverage issue comes from.

Copy link
Contributor

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

_unittest/test_21_Circuit.py Outdated Show resolved Hide resolved
_unittest/test_35_MaxwellCircuit.py Outdated Show resolved Hide resolved
_unittest/test_35_MaxwellCircuit.py Outdated Show resolved Hide resolved
_unittest/test_35_MaxwellCircuit.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/modeler/circuits/primitives_circuit.py Outdated Show resolved Hide resolved
DaveTwyman and others added 5 commits November 5, 2024 10:02
Co-authored-by: gmalinve <103059376+gmalinve@users.noreply.github.com>
Co-authored-by: gmalinve <103059376+gmalinve@users.noreply.github.com>
Co-authored-by: gmalinve <103059376+gmalinve@users.noreply.github.com>
Co-authored-by: gmalinve <103059376+gmalinve@users.noreply.github.com>
Co-authored-by: gmalinve <103059376+gmalinve@users.noreply.github.com>
DaveTwyman and others added 5 commits November 12, 2024 11:25
…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
# Conflicts:
#	tests/system/general/test_21_Circuit.py
@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 ?

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
3 participants