Commit 227e2f8
Fix MolecularFormula._calc_kmd ignoring kendrick_rounding_method
MolecularFormulaCalc._calc_kmd() used int() to derive the nominal
Kendrick mass, which always truncates toward zero (equivalent to floor
for positive values). This ignored the user-configurable
kendrick_rounding_method setting (floor/ceil/round) that
MSPeakCalc._calc_kmd() already respects.
Now reads kendrick_rounding_method from the parent peak's settings
(or MSParameters.ms_peak as fallback) and applies the same
floor/ceil/rint logic as MSPeakCalc.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0176770 commit 227e2f8
1 file changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
714 | 721 | | |
715 | 722 | | |
716 | 723 | | |
717 | 724 | | |
718 | 725 | | |
719 | 726 | | |
720 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
721 | 738 | | |
722 | 739 | | |
723 | 740 | | |
| |||
0 commit comments