-
Notifications
You must be signed in to change notification settings - Fork 28
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
Small Miscellaneous coil fixes #1311
base: master
Are you sure you want to change the base?
Conversation
num_turns
attribute to coils
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1311 +/- ##
=======================================
Coverage 95.69% 95.69%
=======================================
Files 101 101
Lines 25633 25638 +5
=======================================
+ Hits 24529 24534 +5
Misses 1104 1104
|
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_lowres | +1.07 +/- 6.60 | +6.10e-03 +/- 3.75e-02 | 5.75e-01 +/- 3.4e-02 | 5.69e-01 +/- 1.6e-02 |
test_equilibrium_init_medres | -0.09 +/- 5.43 | -4.07e-03 +/- 2.43e-01 | 4.47e+00 +/- 1.7e-01 | 4.47e+00 +/- 1.7e-01 |
test_equilibrium_init_highres | -0.81 +/- 4.52 | -4.67e-02 +/- 2.60e-01 | 5.69e+00 +/- 2.0e-01 | 5.74e+00 +/- 1.6e-01 |
test_objective_compile_dshape_current | +1.00 +/- 4.93 | +4.24e-02 +/- 2.10e-01 | 4.30e+00 +/- 1.2e-01 | 4.25e+00 +/- 1.7e-01 |
test_objective_compute_dshape_current | -0.47 +/- 2.43 | -2.49e-05 +/- 1.28e-04 | 5.26e-03 +/- 8.6e-05 | 5.28e-03 +/- 9.6e-05 |
test_objective_jac_dshape_current | +0.60 +/- 6.57 | +2.59e-04 +/- 2.87e-03 | 4.38e-02 +/- 1.5e-03 | 4.36e-02 +/- 2.4e-03 |
test_perturb_2 | -0.80 +/- 1.52 | -1.66e-01 +/- 3.14e-01 | 2.05e+01 +/- 2.4e-01 | 2.06e+01 +/- 2.0e-01 |
test_proximal_freeb_jac | +0.86 +/- 2.07 | +6.48e-02 +/- 1.55e-01 | 7.55e+00 +/- 1.4e-01 | 7.49e+00 +/- 5.7e-02 |
test_solve_fixed_iter | -0.52 +/- 2.44 | -1.74e-01 +/- 8.09e-01 | 3.29e+01 +/- 6.1e-01 | 3.31e+01 +/- 5.3e-01 |
test_LinearConstraintProjection_build | +0.49 +/- 3.01 | +5.26e-02 +/- 3.21e-01 | 1.07e+01 +/- 2.4e-01 | 1.07e+01 +/- 2.1e-01 |
test_build_transform_fft_midres | +0.40 +/- 1.75 | +2.41e-03 +/- 1.06e-02 | 6.07e-01 +/- 8.0e-03 | 6.04e-01 +/- 6.9e-03 |
test_build_transform_fft_highres | +1.71 +/- 6.20 | +1.66e-02 +/- 6.03e-02 | 9.88e-01 +/- 6.0e-02 | 9.72e-01 +/- 7.0e-03 |
test_equilibrium_init_lowres | -0.07 +/- 2.04 | -2.56e-03 +/- 7.85e-02 | 3.85e+00 +/- 5.9e-02 | 3.85e+00 +/- 5.2e-02 |
test_objective_compile_atf | +1.22 +/- 3.37 | +1.02e-01 +/- 2.80e-01 | 8.41e+00 +/- 1.3e-01 | 8.31e+00 +/- 2.5e-01 |
test_objective_compute_atf | +0.04 +/- 1.78 | +6.61e-06 +/- 2.80e-04 | 1.57e-02 +/- 2.3e-04 | 1.57e-02 +/- 1.6e-04 |
test_objective_jac_atf | +0.14 +/- 5.01 | +2.80e-03 +/- 9.93e-02 | 1.98e+00 +/- 5.8e-02 | 1.98e+00 +/- 8.1e-02 |
test_perturb_1 | +0.01 +/- 1.53 | +1.78e-03 +/- 2.25e-01 | 1.47e+01 +/- 1.0e-01 | 1.47e+01 +/- 2.0e-01 |
test_proximal_jac_atf | +0.85 +/- 1.87 | +7.01e-02 +/- 1.55e-01 | 8.36e+00 +/- 1.2e-01 | 8.29e+00 +/- 9.7e-02 |
test_proximal_freeb_compute | +0.57 +/- 0.97 | +1.14e-03 +/- 1.93e-03 | 2.01e-01 +/- 1.1e-03 | 2.00e-01 +/- 1.6e-03 |
test_solve_fixed_iter_compiled | +0.03 +/- 1.13 | +6.75e-03 +/- 2.34e-01 | 2.07e+01 +/- 1.5e-01 | 2.07e+01 +/- 1.8e-01 | |
This might not be needed once we decide on #1169 actually, if we have some sort of nfilaments thing there... |
Better to do a subclass of curve instead of coil for stuff like Rogowski etc |
num_turns
attribute to coils@@ -238,6 +252,7 @@ def current(self): | |||
|
|||
@current.setter | |||
def current(self, new): | |||
new = setdefault(new, 1, new) |
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.
What is the purpose of this? Wouldn't this prevent someone from setting the current to 0, since 0 = False and so it would get replaced with the default value of 1?
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 you might have meant to do new = setdefault(new, 1)
@@ -689,8 +704,6 @@ def from_values(cls, current, coords, N=10, NFP=1, basis="rpz", sym=False, name= | |||
sym : bool | |||
Whether to enforce stellarator symmetry. | |||
name : str | |||
name for this coil |
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.
Why delete this? I think it should still say Name for this coil.
like we have for all the similar methods of other coil classes.
Name for this coil. | ||
name for this coil |
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 prefer proper punctuation in our doc strings, I think we do that in most cases
FourierXYZCoil