docs: update documentation files and fix linting issues
This commit is contained in:
@@ -51,8 +51,11 @@ fitter/ ← main analysis framework
|
||||
├── result.py ← FitResult, analysis results
|
||||
# └── report.py ← PDF report generation (deferred)
|
||||
|
||||
visualize/ ← visualization / plotting
|
||||
└── visualize/__init__.py ← BetaSpectrumAnalyzer
|
||||
output/ ← output, visualization, CSV export
|
||||
├── __init__.py ← BetaSpectrumAnalyzer, CSVEmitter, Visualizer
|
||||
├── core.py ← BetaSpectrumAnalyzer base class
|
||||
├── csv_export.py ← CSV export functionality
|
||||
└── visualization.py ← Plotting and visualization functionality
|
||||
```
|
||||
|
||||
### Rationale
|
||||
@@ -64,6 +67,7 @@ visualize/ ← visualization / plotting
|
||||
### Migration Plan
|
||||
|
||||
#### Phase 1: Create `exp_data` module ✅ COMPLETE
|
||||
|
||||
- [x] `exp_data/spectrum.py` — `ExpSpectrum` dataclass: energies, counts, errors, metadata
|
||||
- [x] `exp_data/calibration.py` — `EnergyCalibrator` + `CalibrationResult`: linear/quadratic channel→energy
|
||||
- [x] `exp_data/fitters.py` — `GaussianFitter` + `PeakFitter`: peak detection and fitting
|
||||
@@ -71,6 +75,7 @@ visualize/ ← visualization / plotting
|
||||
- [x] 43 tests, ruff + mypy clean
|
||||
|
||||
#### Phase 2: Create `fitter` module ✅ COMPLETE
|
||||
|
||||
- [x] `fitter/model.py` — `SpectrumModel`: wraps `BetaSpectrum` + `DetectorResponse`, callable model with convolution
|
||||
- [x] `fitter/fit_engine.py` — `SpectrumFitter` + `FitConfig` + `FitResult`: χ² fitting, covariance, profile likelihood, confidence intervals
|
||||
- [x] `fitter/extractor.py` — `CWExtractor` + `GVAExtractor`: C(W) and g_V/g_A extraction
|
||||
@@ -79,6 +84,7 @@ visualize/ ← visualization / plotting
|
||||
- [x] Detector convolution handles W < 1.0 edge cases
|
||||
|
||||
#### Phase 3: Clean up `beta_spectrum` ✅ COMPLETE
|
||||
|
||||
- [x] Remove `cw_extractor.py` (moved to `fitter/extractor.py`)
|
||||
- [x] Remove `fitter.py` (moved to `fitter/fit_engine.py`)
|
||||
- [x] Clean up `__init__.py` — only exports theory classes
|
||||
@@ -88,6 +94,7 @@ visualize/ ← visualization / plotting
|
||||
- [x] 322 tests pass, ruff + mypy clean on all 26 source files
|
||||
|
||||
#### Phase 4: Update package structure ✅ COMPLETE
|
||||
|
||||
- [x] `pyproject.toml` auto-discovers all 4 packages via `setuptools.packages.find`
|
||||
- [x] `beta_spectrum.cli` keeps CLI entry point (no re-exports needed)
|
||||
- [x] All imports updated across 26 source files
|
||||
@@ -313,6 +320,7 @@ ______________________________________________________________________
|
||||
**Version:** 0.3.1 → **In progress: 0.4.0 — Package restructuring**
|
||||
|
||||
### Completed (v0.3.x)
|
||||
|
||||
- All theoretical corrections: phase space, Fermi function, finite size, screening, exchange, radiative (with delta_cut resummation)
|
||||
- Detector response module with analytical models (Gaussian, Gaussian+tail, Tikhonov), convolution API
|
||||
- χ² curve fitting framework (CurveFitter) with confidence intervals, profile likelihood, correlation analysis
|
||||
@@ -327,20 +335,22 @@ ______________________________________________________________________
|
||||
- Plot output: unified multi-branch approach, externalized headers, compact legends, consistent titles
|
||||
|
||||
### Completed (v0.4.0)
|
||||
|
||||
- **Track B: Package restructuring** — separating into `beta_spectrum` (theory), `exp_data` (experimental data), `fitter` (analysis framework)
|
||||
- [x] Phase 1: Create `exp_data` module (raw_data.py, calibration.py, fitters.py, corrections.py, spectrum.py) — 43 tests
|
||||
- [x] Phase 2: Create `fitter` module (model.py, fit_engine.py, extractor.py, result.py) — 34 tests
|
||||
- [x] Phase 3: Clean up `beta_spectrum` (remove cw_extractor.py, fitter.py, __init__.py cleanup) — 322 tests
|
||||
- [x] Phase 3: Clean up `beta_spectrum` (remove cw_extractor.py, fitter.py, **init**.py cleanup) — 322 tests
|
||||
- [x] Phase 4: Package auto-discovered by setuptools, all imports updated, black formatting applied
|
||||
- **v0.4.0 is COMPLETE**
|
||||
- 322 tests pass (262 original + 60 new)
|
||||
- ruff + mypy clean on all 26 source files
|
||||
- black formatting applied to all new code
|
||||
- `pyproject.toml` auto-discovers all 4 packages: `beta_spectrum`, `beta_spectrum.visualize`, `exp_data`, `fitter`
|
||||
- `pyproject.toml` auto-discovers all 4 packages: `beta_spectrum`, `beta_spectrum.output`, `exp_data`, `fitter`
|
||||
- README updated with new architecture diagram and Quick Start examples
|
||||
- Version bumped to 0.4.0
|
||||
|
||||
### Next Immediate Step
|
||||
|
||||
- **Track A: ⁹⁹Tc spectrum-shape analysis** — start real data processing pipeline
|
||||
- Data processing pipeline for experimental runs
|
||||
- Endpoint fitting and energy calibration
|
||||
|
||||
Reference in New Issue
Block a user