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

Remove vaccum objective option from Equilibrium.solve #933

Merged
merged 12 commits into from
Mar 17, 2024

Conversation

f0uriest
Copy link
Member

@f0uriest f0uriest commented Mar 7, 2024

  • Removes "vacuum" option from Equilibrium.solve, solve_continuation and get_equilibrium_objective, since it is non-trivial to check that the user didn't make a mistake with assigning compatible profiles.
  • Keeps the option from the input file, but now just switches to force balance and explicitly drops any user supplied profiles and warns.

Resolves #809

Copy link
Contributor

github-actions bot commented Mar 7, 2024

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_lowres         |     -0.23 +/- 1.61     | -4.17e-03 +/- 2.88e-02 |  1.78e+00 +/- 2.6e-02  |  1.79e+00 +/- 1.2e-02  |
 test_build_transform_fft_midres         |     -0.15 +/- 1.73     | -2.86e-03 +/- 3.40e-02 |  1.96e+00 +/- 3.3e-02  |  1.96e+00 +/- 7.8e-03  |
 test_build_transform_fft_highres        |     -0.63 +/- 1.28     | -1.48e-02 +/- 3.03e-02 |  2.34e+00 +/- 1.6e-02  |  2.36e+00 +/- 2.6e-02  |
 test_equilibrium_init_lowres            |     +0.27 +/- 0.47     | +2.57e-02 +/- 4.49e-02 |  9.62e+00 +/- 3.1e-02  |  9.59e+00 +/- 3.3e-02  |
 test_equilibrium_init_medres            |     -0.41 +/- 2.54     | -4.23e-02 +/- 2.61e-01 |  1.02e+01 +/- 1.1e-01  |  1.03e+01 +/- 2.4e-01  |
 test_equilibrium_init_highres           |     -0.22 +/- 0.86     | -2.64e-02 +/- 1.04e-01 |  1.21e+01 +/- 7.2e-02  |  1.21e+01 +/- 7.5e-02  |
 test_objective_compile_dshape_current   |     -0.59 +/- 9.86     | -2.31e-02 +/- 3.84e-01 |  3.87e+00 +/- 2.7e-01  |  3.90e+00 +/- 2.7e-01  |
 test_objective_compile_atf              |     +0.69 +/- 5.83     | +5.09e-02 +/- 4.32e-01 |  7.46e+00 +/- 2.7e-01  |  7.41e+00 +/- 3.3e-01  |
 test_objective_compute_dshape_current   |     -1.41 +/- 1.57     | -7.53e-05 +/- 8.34e-05 |  5.25e-03 +/- 5.8e-05  |  5.32e-03 +/- 6.0e-05  |
 test_objective_compute_atf              |     +1.54 +/- 1.41     | +3.01e-04 +/- 2.74e-04 |  1.98e-02 +/- 2.2e-04  |  1.95e-02 +/- 1.6e-04  |
 test_objective_jac_dshape_current       |     +7.55 +/- 5.18     | +2.95e-03 +/- 2.02e-03 |  4.21e-02 +/- 1.5e-03  |  3.91e-02 +/- 1.4e-03  |
 test_objective_jac_atf                  |     +0.58 +/- 3.07     | +1.08e-02 +/- 5.73e-02 |  1.87e+00 +/- 2.5e-02  |  1.86e+00 +/- 5.2e-02  |
 test_perturb_1                          |     -0.80 +/- 3.55     | -1.24e-01 +/- 5.48e-01 |  1.53e+01 +/- 3.8e-01  |  1.54e+01 +/- 4.0e-01  |
 test_perturb_2                          |     -1.39 +/- 1.31     | -2.82e-01 +/- 2.66e-01 |  2.01e+01 +/- 2.5e-01  |  2.04e+01 +/- 9.6e-02  |
 test_proximal_jac_atf                   |     +0.17 +/- 1.33     | +1.19e-02 +/- 9.47e-02 |  7.13e+00 +/- 6.4e-02  |  7.11e+00 +/- 7.0e-02  |
 test_proximal_freeb_compute             |     -1.24 +/- 0.86     | -1.54e-03 +/- 1.07e-03 |  1.22e-01 +/- 8.8e-04  |  1.24e-01 +/- 6.1e-04  |
 test_proximal_freeb_jac                 |     +0.08 +/- 1.06     | +5.50e-03 +/- 7.40e-02 |  6.98e+00 +/- 3.7e-02  |  6.98e+00 +/- 6.4e-02  |

f.write("\n# pressure and rotational transform/current profiles\n")
for l in range(L_profile):
f.write(
"l: {:3d} p = {:15.8E} {} = {:15.8E}\n".format(
int(l), pres_profile.params[l], char, profile.params[l]
int(l), p1[l], char, p2[l]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously this was writing the wrong mode numbers if the profiles were even power series. The logic above now copies them all to a non-symmetric basis before outputting

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.71%. Comparing base (68c971f) to head (1e0def0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #933      +/-   ##
==========================================
- Coverage   94.71%   94.71%   -0.01%     
==========================================
  Files          86       86              
  Lines       21198    21207       +9     
==========================================
+ Hits        20078    20086       +8     
- Misses       1120     1121       +1     
Files Coverage Δ
desc/continuation.py 93.60% <ø> (ø)
desc/equilibrium/equilibrium.py 96.63% <ø> (ø)
desc/input_reader.py 91.90% <100.00%> (+0.10%) ⬆️
desc/objectives/getters.py 85.93% <100.00%> (-1.95%) ⬇️

@f0uriest f0uriest mentioned this pull request Mar 9, 2024
desc/input_reader.py Outdated Show resolved Hide resolved
dpanici
dpanici previously approved these changes Mar 14, 2024
Copy link
Collaborator

@dpanici dpanici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed my only gripe (the warning), I approve now

@f0uriest f0uriest merged commit cf8ff2c into master Mar 17, 2024
17 checks passed
@f0uriest f0uriest deleted the rc/vacuum_objective branch March 17, 2024 17:29
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 warning for vacuum solve with iota profile
3 participants