Skip to content

Record passing-orbit filters in NetCDF results#485

Open
krystophny wants to merge 1 commit into
mainfrom
fix/netcdf-passing-filter-metadata
Open

Record passing-orbit filters in NetCDF results#485
krystophny wants to merge 1 commit into
mainfrom
fix/netcdf-passing-filter-metadata

Conversation

@krystophny

Copy link
Copy Markdown
Member

Summary

  • write contr_pp and notrace_passing as global attributes in results.nc
  • verify an explicit nondefault threshold and the integer trace switch through the Python NetCDF test

Review path

  1. Review the two additive nf90_put_att calls in src/netcdf_results_output.f90.
  2. Review the four test lines in test/python/test_netcdf_results.py.
  3. Confirm that the output schema change is additive and metadata-only.

Preserved invariants

This does not change the Hamiltonian, particle source, field, boundary event,
integration, convergence criteria, orbit classification, memory layout, ABI,
or generated trajectory data. It only records two existing run controls so a
downstream analysis can distinguish traced and intentionally skipped passing
orbits without recovering the input namelist.

Verification

Failing before

After adding the assertions but before writing the attributes:

$ ctest --test-dir build-python -R '^test_netcdf_results$' --output-on-failure
TestNetCDFResultsOutput::test_results_netcdf_created FAILED
E   AttributeError: NetCDF: Attribute not found

Passing after

$ uv run --with-requirements requirements.txt --no-project bash -c \
  'export PYTHONPATH="$PWD/build-python/python:$PWD/build-python:$PWD/python"; \
   python -m pytest test/python/test_netcdf_results.py::TestNetCDFResultsOutput::test_results_netcdf_created -v'
1 passed in 17.87s

$ FO_TEST_TIMEOUT=600 fo
Static: OK (192 modules, 192 changed, 192 affected)
Build: OK
Tests: OK
Lint: OK
All stages passed

fo also reports the pre-existing whole-file formatting warning for
netcdf_results_output.f90; this focused PR does not reindent unrelated lines.

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.

1 participant