feat(cli): separate-branches rename, short aliases, clean dry-run
- --normalize-to-one renamed to --separate-branches (no alias; the name now describes the output choice: total spectrum with intensity-normalized branches vs separate branches, each normalized to unit area with intensities left to the data user). SpectrumConfig.normalize_to_one -> separate_branches, CSV header word to_one -> separate. - every long option gains a single-letter alias: -N -i -s -m -o -p -L -d -c -V -S -b (only -v/-q existed before) - dry-run drops the top-level Transition: line — the per-branch list below already reports each branch's transition type - version bumped to 0.4.1 (pyproject, __version__, CSV semantics docstring, TODO roadmap entry)
This commit is contained in:
@@ -477,7 +477,7 @@ def decay_info_to_config(
|
||||
intensity_cutoff: float = 0.0,
|
||||
neutrino_mass_MeV: float = 0.0,
|
||||
csv_separator: str = ",",
|
||||
normalize_to_one: bool = False,
|
||||
separate_branches: bool = False,
|
||||
) -> SpectrumConfig:
|
||||
"""
|
||||
Convert DecayInfo to a SpectrumConfig.
|
||||
@@ -494,8 +494,9 @@ def decay_info_to_config(
|
||||
Neutrino mass in MeV.
|
||||
csv_separator : str
|
||||
CSV column separator.
|
||||
normalize_to_one : bool
|
||||
If True, normalize each branch to 1, ignoring intensity.
|
||||
separate_branches : bool
|
||||
If True, emit separate branch spectra, each normalized to
|
||||
integrate to 1 (intensity ignored; no total spectrum column).
|
||||
|
||||
Returns
|
||||
-------
|
||||
@@ -535,7 +536,7 @@ def decay_info_to_config(
|
||||
branches=branches,
|
||||
intensity_cutoff=intensity_cutoff,
|
||||
csv_separator=csv_separator,
|
||||
normalize_to_one=normalize_to_one,
|
||||
separate_branches=separate_branches,
|
||||
)
|
||||
|
||||
|
||||
@@ -708,7 +709,7 @@ def create_config_from_source(
|
||||
intensity_cutoff = kwargs.get("intensity_cutoff", 0.0)
|
||||
neutrino_mass = kwargs.get("neutrino_mass_MeV", 0.0)
|
||||
csv_separator = kwargs.get("csv_separator", ",")
|
||||
normalize_to_one = kwargs.get("normalize_to_one", False)
|
||||
separate_branches = kwargs.get("separate_branches", False)
|
||||
info = get_decay_info_from_paceENSDF(nuclide, decay_type, decay_index)
|
||||
return decay_info_to_config(
|
||||
info,
|
||||
@@ -716,7 +717,7 @@ def create_config_from_source(
|
||||
intensity_cutoff=intensity_cutoff,
|
||||
neutrino_mass_MeV=neutrino_mass,
|
||||
csv_separator=csv_separator,
|
||||
normalize_to_one=normalize_to_one,
|
||||
separate_branches=separate_branches,
|
||||
)
|
||||
elif source == "json":
|
||||
if not json_path:
|
||||
|
||||
Reference in New Issue
Block a user