simsopt icon indicating copy to clipboard operation
simsopt copied to clipboard

Fixit boozer surface improvements

Open abaillod opened this issue 8 months ago • 9 comments

One more pull request!

In this one, the BoozerSurface class is made slightly more user-friendly.

The main changes are the implementation of BoozerSurface.as_dict and BoozerSurface.from_dict to allow for saving the BoozerSurface.res dictionary. This should allow users to use a loaded BoozerSurface without having to rerun it.

Other small changed are listed below

  • A new parameter, boozer_type, sets if the Boozer PDE is solved in the least squares sense or exactly.
  • The run_code accepts now a new flag that determines which minimization algorithm is used to solve the PDE when boozer_type='ls'.
  • All lower lever methods, minimize_*, have been renamed to _minimize_* since users should only use the run_code method.
  • Tests and documentation have been adadpted accordingly.

abaillod avatar May 07 '25 20:05 abaillod

in renaming the minimize functions, this line won't run anymore

https://github.com/hiddenSymmetries/simsopt/blob/f0f0ec45fe518e46567f28c9912a505dcdc5ec0f/examples/2_Intermediate/boozerQA.py#L69

the example should be updated

andrewgiuliani avatar May 07 '25 20:05 andrewgiuliani

Codecov Report

Attention: Patch coverage is 97.10145% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.05%. Comparing base (32688cf) to head (16a4550). Report is 87 commits behind head on master.

Files with missing lines Patch % Lines
src/simsopt/geo/boozersurface.py 97.10% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
- Coverage   92.30%   92.05%   -0.25%     
==========================================
  Files          82       82              
  Lines       16015    16068      +53     
==========================================
+ Hits        14782    14792      +10     
- Misses       1233     1276      +43     
Flag Coverage Δ
unittests 92.05% <97.10%> (-0.25%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 08 '25 00:05 codecov[bot]

I updated the examples.

Misha, how do I update the base of my branch? I am not sure what you mean.

abaillod avatar May 08 '25 20:05 abaillod

I am confused why some of the documentation changes that have already been landed on master look like new changes on your branch. Perhaps your branch point is behind previous changes. You could try,

git fetch
git rebase origin/master

Warning it might cause some conflicts that you have to resolve.

mishapadidar avatar May 08 '25 20:05 mishapadidar

I think ChatGPT and I resolved all the points you raised! Let me know what you think!

abaillod avatar May 12 '25 15:05 abaillod

two important lines are missing in code coverage

andrewgiuliani avatar May 13 '25 15:05 andrewgiuliani

@abaillod just pinging to check in.

mishapadidar avatar Jun 12 '25 14:06 mishapadidar

I fixed some of the points you raised; there are still a few open discussion - please answer and I will try to finalize this next week

abaillod avatar Sep 12 '25 20:09 abaillod

@abaillod friendly reminder

mishapadidar avatar Oct 02 '25 14:10 mishapadidar