Repository navigation
Equilibrium - BUGFIX! - Place read_imas profiles on the stored psi grid - #499
Conversation
|
@claude review this |
|
Review of #499 The fix is correct and minimal: normalizing Points to consider:
Minor: the existing comment "Extract 1D profiles, converting psi..." is still accurate, but a short note that the grid is normalized by the axis/boundary psi would help readers, since the previous code looked equally plausible. Per CLAUDE.md: this PR must not be merged into |
|
@jhalpern30 do you think this really needs a test? |
Yeah I don't think this one needs a unit test. I do however like the suggestion of adding informative assert statements around this change. Its hard to be completely agnostic for all input types, and I'd rather it error out in a useful way and we can then modify it if a new equilibrium type or input comes along. For example, adding in the basic assumptions as assertions here (monotonic, between 0 to 1, anything else) is probably the way to go. So @calin1989, my suggestions here are then to
Then you can ping me again and it should be good to go |
8b30576 to
f5e764f
Compare
jhalpern30
left a comment
There was a problem hiding this comment.
@logan-nc assuming this fixes the issue you had with the SPARC equilibria and will merge this later today
Everything from original review been addressed, and PR has my approval already - only thing holding up the merge
Release note
profiles_1dgrid is not uniform in ψ_N, or does not start atpsi_axis; none for the regression suite (harness @ 0d056d4)profiles_1dgrid is not uniform in ψ_N.read_imasnow places F, p and q on the ψ grid stored inprofiles_1d.psi. It previously assumed a uniform ψ_N grid, so on non-uniform grids the pressure, and with it β and stability, was evaluated on the wrong flux surfaces.Fixes #482
Regression report
Notes for reviewers
Two assertions gate the input:
profiles_1d.psimust increase strictly and lie betweenpsi_axisandpsi_boundary. Grids that break these assumptions stop with a clear message instead of producing a wrong spline.🤖 Generated with Claude Code