Tags: proximafusion/vmecpp
Tags
Add lrfp_logical_ flag to wout for Fortran VMEC compatibility (Python… …-only) (#399) Add lrfp_logical_ flag to wout for Fortran VMEC compatibility (Python-only) (#399) ## Summary Fixed CI error `AttributeError: 'vmecpp.cpp._vmecpp.WOutFileContents' object has no attribute 'lrfp'` by properly handling the Python-only `lrfp` field during Python<->C++ conversions. ## Changes Made - [x] **Reverted all C++ changes**: Removed lrfp from VmecINDATA, WOutFileContents, and pybind11 bindings - [x] **Removed lrfp from VmecInput**: No C++ backend to support it as an input parameter - [x] **Kept lrfp in VmecWOut**: Handles reading from and writing to Fortran wout files - [x] **Removed test_lrfp_flag_in_wout()**: Existing tests cover the functionality - [x] **Kept lrfp__logical__ removal from _MISSING_FORTRAN_VARIABLES**: Python side now handles it - [x] **Added lrfp to _CPP_WOUT_SPECIAL_HANDLING**: Skips the field during Python<->C++ conversion - [x] **Set lrfp default in _from_cpp_wout**: Initializes to False when converting from C++ to Python ## What Remains **Python-side only** (`src/vmecpp/__init__.py`): - `VmecWOut.lrfp` field with Pydantic annotations for NetCDF serialization - `VmecWOut.lrfp__logical__()` property for Fortran compatibility - Backwards compatibility: `setdefault("lrfp__logical__", 0)` for old wout files - Removed from `_MISSING_FORTRAN_VARIABLES` list in tests - Added to `_CPP_WOUT_SPECIAL_HANDLING` to skip during Python<->C++ conversions - Default value set to `False` in `_from_cpp_wout()` method This allows loading Fortran VMEC wout files with lrfp flag without requiring special handling, while keeping implementation minimal on Python side only and properly handling C++ interop. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > add the lrfp_logical_ with default to false to the wout, to allow them to avoid having to treat VMEC++ files in any special way. Use the same pattern for adding a boolean flag as for the other flags (accessible as lrfp property from python, but written to netcdf with the logical suffix) and make sure wout files WITHOUT the flags, stay backwards compatible. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. Co-authored-by: copilot-swe-agent <198982749+copilot-swe-agent@users.noreply.github.com>
szip requirement in netcdf, limit version (#397) **This fixes the pip wheel failiure** The new NetCDF version made szip a hard requirement. Since we ship binary dependencies with the wheel, we decided to limit the netcdf version for now instead of shipping a larger binary package. This is not a permanent solution, and if it becomes a problem, we need to add szip to the linux images for the wheel build.
Improved Sphinx docs (Cleaned up docstrings and config) (#358) - Added examples and fourier basis  - run and VmecInput show up at the top instead of JxBout  - Made sure latex and code blocks are rendered correctly  - Make sure the example plot shows up in the online docs (relative filepath issue) <img width="918" height="687" alt="image" src="https://github.com/user-attachments/assets/e1bf487b-ed9a-4dea-b6b9-adadfb420910" />
PreviousNext