refactor: centralize all physical constants in constants.py, fix unit naming

- Add EULER_GAMMA, ME_KEV, R0_FM to constants.py
- Replace hardcoded 0.511, 0.5772..., 1.2 with imports from constants
- Fix T_to_W parameter name: T_kev -> T_MeV (it takes MeV, not keV)
- Remove duplicate ME_ME from spectrum.py (import ME_MEV from constants)
- Remove hardcoded r_0 from detector_response.py and radiative.py
- Update CONVENTIONS.md to reference correct constant names
This commit is contained in:
2026-05-01 22:34:15 +03:00
parent 6a671bfb8b
commit 8b4545fe3e
6 changed files with 28 additions and 18 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ All conversions and constants must go through the central utilities:
```python
from beta_spectrum.utils import T_to_W, W_to_T
from beta_spectrum.constants import ME_ME, ME_KEV, ALPHA, M_P
from beta_spectrum.constants import ME_MEV, ME_KEV, ALPHA, MP_MEV
```
- Never hardcode physical constants — import from `constants.py`