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

Updated CircularCoil class to alllow for dofs #377

Merged
merged 13 commits into from
Apr 25, 2024

Conversation

jloizu
Copy link
Contributor

@jloizu jloizu commented Nov 7, 2023

I have (with some help from Jason, thanks!) modified the class CircularCoil in order to define its attributes (r0, I, normal, etc.) as degrees of freedom so that the object can be used in optimization of circular coil fields. This should not prevent a nominal use of the class, namely without optimization.

@andrewgiuliani
Copy link
Contributor

andrewgiuliani commented Nov 7, 2023

we would need unit tests that cover this new functionality.

Also a broader question is: what about the other magnetic fields in this file (ToroidalField, PoloidalField, DipoleField, etc)? they don't have this added support. Not saying that we need to, but just something that I noticed.

@jloizu
Copy link
Contributor Author

jloizu commented Nov 8, 2023

we would need unit tests that cover this new functionality.

Also a broader question is: what about the other magnetic fields in this file (ToroidalField, PoloidalField, DipoleField, etc)? they don't have this added support. Not saying that we need to, but just something that I noticed.

About unit tests, sure, I can try to do that, but you mean creating new tests for this part or running already existing tests?

About you broader question: yes I agree, we can think of extending this to other magnetic field objects – one step at a time :)

@smoniewski
Copy link
Contributor

I tried writing unit tests in #379.

I also added the output to plot the circular coil. That made me remember that this field is tied to a specific coil, but that coil is not a geometry object. So this coil will not work for any of the regular curve objectives. Perhaps we should have a CircularCoil curve object that gets its field from CircularCoilField. However, I'm not sure that should be in the scope of this pull request.

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: Patch coverage is 77.04918% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 91.10%. Comparing base (d830719) to head (7d88bd9).

❗ Current head 7d88bd9 differs from pull request most recent head d82cb17. Consider uploading reports for the commit d82cb17 to get more accurate results

Files Patch % Lines
src/simsopt/field/magneticfieldclasses.py 77.04% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #377      +/-   ##
==========================================
- Coverage   91.55%   91.10%   -0.46%     
==========================================
  Files          74       74              
  Lines       12911    12956      +45     
==========================================
- Hits        11821    11803      -18     
- Misses       1090     1153      +63     
Flag Coverage Δ
unittests 91.10% <77.04%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@smoniewski
Copy link
Contributor

With no activity for a couple months, I think its about time to complete this pull request. I created a new issue for the discussion of further additions to magneticfieldclasses.py.

smoniewski
smoniewski previously approved these changes Feb 6, 2024
@jloizu
Copy link
Contributor Author

jloizu commented Feb 6, 2024

Thanks for reviving this, indeed I think we should go ahead with this and then if necessary carry out further additions/improvements to the class. I have been testing it for a while and it looks good to me!

Is it normal that the Linting CI tests fail? can one ignore that?

@jloizu
Copy link
Contributor Author

jloizu commented Feb 6, 2024

sorry but I had forgotten to add this minor quick fix that avoids errors when using load/save functions.

@landreman landreman self-requested a review April 25, 2024 20:37
@landreman landreman merged commit c243322 into master Apr 25, 2024
41 of 45 checks passed
@smiet smiet deleted the circularcoil_dofs_update branch July 8, 2024 11:13
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.

5 participants