feat(cli): report core in dry-run, build plots from exported CSV
This commit is contained in:
+17
-10
@@ -40,7 +40,6 @@ def _build_parser() -> argparse.ArgumentParser:
|
|||||||
" bs_pnpi --nuclide Tc99 --output spectrum.csv\n"
|
" bs_pnpi --nuclide Tc99 --output spectrum.csv\n"
|
||||||
" bs_pnpi --input custom_input.json --output spectrum.csv\n"
|
" bs_pnpi --input custom_input.json --output spectrum.csv\n"
|
||||||
" bs_pnpi --nuclide Tc99 --plot spectrum.png --output spectrum.csv\n"
|
" bs_pnpi --nuclide Tc99 --plot spectrum.png --output spectrum.csv\n"
|
||||||
" bs_pnpi --nuclide Tc99 --detector gaussian --output convolved.csv\n"
|
|
||||||
" bs_pnpi --nuclide Tc99 --output spectrum.csv -vv --log-file /tmp/calc.log\n"
|
" bs_pnpi --nuclide Tc99 --output spectrum.csv -vv --log-file /tmp/calc.log\n"
|
||||||
" bs_pnpi --nuclide Tc99 --dry-run\n"
|
" bs_pnpi --nuclide Tc99 --dry-run\n"
|
||||||
),
|
),
|
||||||
@@ -326,13 +325,24 @@ def _run(args: argparse.Namespace) -> None:
|
|||||||
)
|
)
|
||||||
logger.info("Spectrum exported to %s", args.output)
|
logger.info("Spectrum exported to %s", args.output)
|
||||||
|
|
||||||
# Generate plot
|
# Generate plot — always built from the exported CSV data (single
|
||||||
|
# source of truth): when a full-verbosity CSV was exported it is
|
||||||
|
# plotted directly from that file, otherwise via a temporary export.
|
||||||
if args.plot:
|
if args.plot:
|
||||||
analyzer = BetaSpectrumAnalyzer(spectrum, config, logger=logger)
|
analyzer = BetaSpectrumAnalyzer(spectrum, config, logger=logger)
|
||||||
analyzer.plot_analysis(
|
if args.output and args.csv_verbosity == "full":
|
||||||
save_path=args.plot,
|
from beta_spectrum.output.visualization import Visualizer
|
||||||
show_components=(args.verbose >= 2),
|
|
||||||
)
|
Visualizer.plot_from_csv(
|
||||||
|
args.output,
|
||||||
|
save_path=args.plot,
|
||||||
|
show_components=(args.verbose >= 2),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
analyzer.plot_analysis(
|
||||||
|
save_path=args.plot,
|
||||||
|
show_components=(args.verbose >= 2),
|
||||||
|
)
|
||||||
logger.info("Analysis plot saved to %s", args.plot)
|
logger.info("Analysis plot saved to %s", args.plot)
|
||||||
|
|
||||||
logger.info("Done.")
|
logger.info("Done.")
|
||||||
@@ -342,11 +352,8 @@ def _print_dry_run_output(config, source_type: str) -> None:
|
|||||||
"""Print resolved configuration for dry-run mode."""
|
"""Print resolved configuration for dry-run mode."""
|
||||||
from beta_spectrum.logging_utils import get_git_short_hash
|
from beta_spectrum.logging_utils import get_git_short_hash
|
||||||
|
|
||||||
|
print("Core: phase_space × fermi (basic spectrum, always included)")
|
||||||
enabled = []
|
enabled = []
|
||||||
if config.use_phase_space:
|
|
||||||
enabled.append("phase_space")
|
|
||||||
if config.use_fermi:
|
|
||||||
enabled.append("fermi")
|
|
||||||
if config.use_screening:
|
if config.use_screening:
|
||||||
enabled.append("screening")
|
enabled.append("screening")
|
||||||
if config.use_finite_size:
|
if config.use_finite_size:
|
||||||
|
|||||||
Reference in New Issue
Block a user