diff --git a/beta_spectrum/cli.py b/beta_spectrum/cli.py index 476207d..469814c 100644 --- a/beta_spectrum/cli.py +++ b/beta_spectrum/cli.py @@ -40,7 +40,6 @@ def _build_parser() -> argparse.ArgumentParser: " bs_pnpi --nuclide Tc99 --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 --detector gaussian --output convolved.csv\n" " bs_pnpi --nuclide Tc99 --output spectrum.csv -vv --log-file /tmp/calc.log\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) - # 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: analyzer = BetaSpectrumAnalyzer(spectrum, config, logger=logger) - analyzer.plot_analysis( - save_path=args.plot, - show_components=(args.verbose >= 2), - ) + if args.output and args.csv_verbosity == "full": + from beta_spectrum.output.visualization import Visualizer + + 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("Done.") @@ -342,11 +352,8 @@ def _print_dry_run_output(config, source_type: str) -> None: """Print resolved configuration for dry-run mode.""" from beta_spectrum.logging_utils import get_git_short_hash + print("Core: phase_space × fermi (basic spectrum, always included)") enabled = [] - if config.use_phase_space: - enabled.append("phase_space") - if config.use_fermi: - enabled.append("fermi") if config.use_screening: enabled.append("screening") if config.use_finite_size: