Commit Graph
17 Commits
Author SHA1 Message Date
unzhakov 8599574723 docs: fix stale file references in TODO.md structure and completions 2026-05-22 15:18:17 +03:00
unzhakov 3c0a43ad4d docs: update TODO and AGENTS for v0.4.0 completion
- Mark v0.4.0 as complete in TODO.md with all phases checked
- Update Phase 4 items with actual outcomes
- Next step: Track A 99Tc spectrum-shape analysis
- Add AGENTS instruction to update project metadata on significant
  structural changes (package additions, version bumps, etc.)
2026-05-17 19:31:39 +03:00
unzhakov 38b44b56e6 feat: v0.4.0 package restructuring — split into 4 modules
Separate monolithic beta_spectrum package into:
  beta_spectrum   — pure theory (components, spectrum, CLI, visualize)
  exp_data        — experimental data handling (spectrum, calibration,
                    fitters, corrections)
  fitter          — analysis framework (model, fit_engine, extractor,
                    result)
  beta_spectrum.visualize — plotting (BetaSpectrumAnalyzer)

Phase 1 — exp_data module:
  ExpSpectrum dataclass with metadata, normalization, serialization
  EnergyCalibrator (linear/quadratic calibration)
  GaussianFitter + PeakFitter for calibration sources
  DeadTimeCorrection, PileUpCorrection, BackgroundSubtractor
  43 new tests, ruff + mypy clean

Phase 2 — fitter module:
  SpectrumModel wraps BetaSpectrum + DetectorResponse with convolution
  SpectrumFitter with χ² minimization, covariance, profile likelihood,
  confidence intervals, robust loss functions
  CWExtractor + GVAExtractor for C(W) and g_V/g_A extraction
  AnalysisResult + FitSummary for physics-specific results
  CurveFitter general-purpose callable model fitter
  34 new tests, ruff + mypy clean

Phase 3 — clean up beta_spectrum:
  Remove cw_extractor.py and fitter.py (moved to fitter/)
  Clean __init__.py to export only theory classes
  Add backward-compat methods to CWExtractor
  Fix BetaSpectrumAnalyzer._get_branch_spectrum returning BetaSpectrum
  objects instead of numpy arrays (plot fix)

Phase 4 — package structure:
  Auto-discovered by setuptools (4 packages)
  All imports updated across 26 source files
  Black formatting applied
  322 tests pass (262 original + 60 new)
  ruff + mypy clean on all source files

Bug fixes:
  - Fix multi-branch spectrum plotting: universal component keys
    (Fermi, Screening, etc.) don't have per-branch prefix; fixed
    fallback lookup.
  - Fix negative phase space beyond endpoint: BetaSpectrum returns
    negative values for W > W0; clamp branch spectra to zero.
2026-05-17 18:58:04 +03:00
unzhakov 745bbae4cd refactor: rename 'analyzer' to 'visualize' — analysis belongs to fitter module 2026-05-17 01:33:13 +03:00
unzhakov 10ad3a867b docs: restructure TODO.md with v0.4.0 package architecture plan 2026-05-17 00:34:16 +03:00
unzhakov 1a23283cf1 fix: decay_info_to_config() now passes branches to SpectrumConfig; update docs for paceENSDF completion
- Fixed bug: decay_info_to_config() was dropping branches, causing
  create_config_from_source('paceENSDF') to return single-branch config
- Added BranchConfig import to nuclear_data.py
- Marked B1 (paceENSDF integration) as complete in TODO.md
- Updated README.md with paceENSDF details in Implementation Status
- Updated TODO.md Current Status with v0.3.1 notes
2026-05-16 18:50:06 +03:00
unzhakov ef337073d6 docs: update TODO and README for B3 completion and BranchConfig export
- Cross out B3 in TODO.md with completion details
- Export BranchConfig in __init__.py public API
- Update README to mention per-branch transition types and intensity cutoff
2026-05-08 08:35:01 +03:00
unzhakov 4a3d31de83 Update docs and TODOs for CLI & plot improvements
- README.md: Add features for plot modes, traceability, debug workflow
- README.md: Update BetaSpectrumAnalyzer docs with show_components param
- README.md: Update Quick Start with both plot modes
- README.md: Add output/ to project structure
- TODO.md: Mark B8.4 plot output as completed
- TODO.md: Update Current Status with B8.4
2026-05-05 14:35:11 +03:00
unzhakov 297778d780 Add ./output/ directory for debug verification artifacts and update development workflow
- Create ./output/ with .gitkeep for test run outputs
- Add output/* to .gitignore (negated .gitkeep)
- Add §4.5 Debug Verification to DEVELOPMENT.md: final step of each dev iteration
  - Run bs_pnpi -vv with full parameter consistency checks
  - Required debug logging per component documented
  - Example commands and success criteria
- Update Agent Instructions and Release Checklist
- Mark B8.3 debug verification framework as completed in TODO.md
2026-05-05 10:48:53 +03:00
unzhakov 330ebddaef refactor: refine CLI options and enhance debug logging
- Remove --mode, --transition-type, and --decay-index CLI flags
  (parameters now come from ENSDF data or custom JSON input)
- Clarify energy units in all CLI help text (MeV throughout, keV for detector params)
- Enhance logging verbosity:
  - -v (INFO): shows source, component initialization, workflow steps
  - -vv (DEBUG): shows detailed internals of all spectrum components
    (parameters, evaluation counts, input/output ranges)
- Improve CSV headers with element notation (e.g. Tc99 -> Ru99)
- Add CONVENTIONS.md documenting energy unit and logging conventions
- Update TODO.md with completion status
2026-05-05 09:08:08 +03:00
unzhakov 7a925725ad docs: cross out B2 (Input Flexibility) as implemented
- JSON input fully implemented: load_json_input(), json_to_config(),
  DEFAULT_JSON_SCHEMA with full detector params, CLI --input flag
- ENSDF auto-population fully implemented: get_decay_info_from_paceENSDF()
  returns DecayInfo with Z_parent, Z_daughter, A_number, endpoint_MeV,
  transition_type, forbiddenness_code, half_life, branches;
  CLI --nuclide uses this automatically
- Update Current Status to reflect B2 completion
2026-05-04 17:06:47 +03:00
unzhakov 0b5fe88f7b docs: remove stale checkboxes, consolidate README vs TODO
- TODO.md: cross out completed A2 (detector response) and A4 (fitter/CW extraction) items with strikethrough and implementation notes
- README.md: replace redundant Components and Additional Modules tables with Implementation Status section referencing TODO.md
- Eliminates duplicate status tracking between README and TODO
2026-05-04 16:01:54 +03:00
unzhakov 9050019ddd feat: add structured logging, CSV metadata headers, and CLI improvements
- New module: beta_spectrum/logging_utils.py
  - LoggingConfig dataclass with level, log_file, format options
  - setup_logging() one-shot configuration (opt-in for library use)
  - get_logger() for named child loggers
  - get_git_short_hash() for commit identification
  - _find_git_root() for repo detection

- CLI enhancements (beta_spectrum/cli.py):
  - --verbose/-v (repeatable): -v=INFO, -vv=DEBUG
  - --quiet/-q: suppress all terminal output
  - --log-file PATH: append log to file
  - --dry-run: validate input, display resolved config, exit
  - --version: show package version
  - Replace print() with structured logging throughout
  - Handle KeyboardInterrupt gracefully

- CSV metadata headers (BetaSpectrumAnalyzer.export_to_csv):
  - YAML-style # comments with version, timestamp, source, nuclide info
  - Corrections enabled, e_step, detector settings, git commit hash

- Base class integration (SpectrumComponent):
  - Optional logger parameter for debug/info output (opt-in)

- BetaSpectrum integration:
  - Optional logger parameter passed through from_config()
  - Detector logging in create_detector_from_config()
  - Convolution logging in convolve_with_detector()

- Tests: tests/test_logging_utils.py (28 tests)
  - LoggingConfig, setup_logging, get_logger, git hash, CSV headers, CLI flags

- Update TODO.md: mark B8 as complete, update Current Status
2026-05-04 15:11:01 +03:00
unzhakov 1a0754be5f docs: remove empty recoil.py stub, update README and TODO to reflect actual state
- Remove empty beta_spectrum/components/recoil.py (0-line stub)
- Remove recoil.py from README.md project tree and components table
- Update TODO.md: replace specific recoil section with generic 'Additional
  Corrections' deferred item, update Current Status to 0.3.0 with actual
  implementation list, mark A4 as complete, set A3 as next step
2026-05-04 11:56:41 +03:00
unzhakov 87c184fb5d docs: add TODO items for CLI improvements and output enhancements (B8) 2026-05-02 22:57:01 +03:00
unzhakov 6854bbff6e docs: update TODO.md with A2 completion and A4 next step
Mark detector response (A2) as complete. Set A4 (fitter routine for
experimental C(W) extraction) as the next immediate step.
2026-05-02 09:41:08 +03:00
unzhakov 5950659514 docs: add strategic development roadmap (TODO.md) 2026-05-01 19:27:51 +03:00