feat(cli): propagate export options through JSON/paceENSDF flows

- main(argv) signature enables in-process CLI invocation and testing
- parser defaults for --e-step/--neutrino-mass/--intensity-cutoff/
  --csv-separator/--normalize-to-one now None = 'not provided'
- JSON flow applies file values by default and CLI flags as overrides
  (previously these five options were silently discarded)
- paceENSDF flow resolves None flags to literal defaults
- new tests/integration/test_cli_flows.py: JSON propagation,
  degenerate-mode non-zero exit with no file (JSON + paceENSDF)
- adapted two neutrino-mass default tests to None-parsing semantics
This commit is contained in:
2026-10-02 05:46:08 +03:00
parent 62bf7fdac2
commit 18a46ad02f
4 changed files with 235 additions and 29 deletions
+7 -2
View File
@@ -118,10 +118,15 @@ class TestNeutrinoMassCLIIntegration:
assert args.neutrino_mass == 0.01, "CLI should parse neutrino_mass correctly"
def test_cli_neutrino_mass_default_value(self):
"""Test that CLI neutrino mass parameter defaults to 0.0."""
"""Unset flag parses as None ("not provided"); the effective
default (0.0 MeV) is applied when the config is built."""
from beta_spectrum.cli import _build_parser
parser = _build_parser()
args = parser.parse_args(["--nuclide", "Tc99"])
assert args.neutrino_mass == 0.0, "CLI neutrino_mass default should be 0.0"
assert args.neutrino_mass is None, (
"unset --neutrino-mass must parse as None so JSON file values "
"are not overwritten"
)
assert hasattr(args, "neutrino_mass")