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:
+1
-1
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user