Large refactor -- replace jitclasses and the relaxation solver with only functions and an explicit solver, pedagogical usability pass#32
Merged
Conversation
…urity fraction fixed mode
…remove unused parameters
- Updated pyproject.toml to use hatchling as the build backend. - Added xarray and contourpy as dependencies. - Specified optional dependency for netCDF4. - Defined project scripts for CLI entry point. - Excluded unnecessary files from the build. - Updated uv.lock to reflect new dependency versions and editable source.
…ove deprecated environment file
- Power balance: make diagnostics consistent with the closed-form solver. populate_outputs/_par and single_point now subtract P_synch from Pheat, and Ploss = Pconf + Pbrems + Psynch, so Pheat == Wtot/tauE at every solved point and Psol/f_rad agree between the grid and single_point. Paux and Q unchanged. - _W_tot_prof: use the electron profile (ID 1) for the electron energy term instead of the ion profile (ID 2). - __check_settings: reject a scaling law with Pheat_alpha == -1, which makes the closed-form (W_tot/K)**(1/(1+alpha)) singular, instead of a NaN grid. - NSF example notebook: replace the stale 5-arg single_point call with the current signature. - README: drop the deleted environment.yml/conda instructions, add pip -e . - pyproject: pin numba>=0.60 (np.trapezoid in njit, cache=True + parallel=True). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ME7GDe8m85XX9WBMyDFWQo
- Introduced `generate_golden.py` to regenerate the golden regression file. - Created `helpers.py` for shared setup and utility functions for tests. - Added `test_invariants.py` to validate physics consistency across runs. - Implemented `test_regression.py` to ensure output matches golden values. - Developed `test_validation.py` to validate settings and reject bad configurations. - Updated `uv.lock` to include new dependencies for testing.
Set each runtime dependency to the lowest version that installs and passes the test suite, verified with a uv resolution sweep (lowest-direct vs highest) across Python 3.10-3.14. numpy 2.0 (for np.trapezoid) is the hard gate and forces the numpy-facing packages up to their first numpy-2-compatible release. - numba>=0.61 (was 0.60): 0.60 cannot compile np.trapezoid in njit, so the previous floor would fail at runtime. - scipy>=1.13, matplotlib>=3.9, contourpy>=1.2.1: first releases allowing numpy 2. - pyyaml>=6.0.2: 6.0/6.0.1 sdists fail to build on Python 3.12+. - xarray>=2023.9.0: lowest verified working under numpy 2. - requires-python raised to <3.15; 3.14 passes on current dependencies. uv.lock relocked to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ME7GDe8m85XX9WBMyDFWQo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three main changes here:
Includes a large rewrite of the main source code.