Skip to content

Commit a3f19fb

Browse files
authored
Merge branch 'master' into dev
2 parents 45b30bb + c4a74bd commit a3f19fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/picor/isotope_correction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def correct_data(uncorrected_data, subset, res_corr_info):
118118
data[label2.as_string] = (
119119
data[label2.as_string] - trans_prob * data[label1.as_string]
120120
)
121+
# Ensure no negative values after correction, but preserve dtype and avoid inplace modification issues
121122
data[label2.as_string] = data[label2.as_string].clip(lower=0)
122123
_logger.info(
123124
f"Transition prob {label1.as_string} -> {label2.as_string}: {trans_prob}"
@@ -146,7 +147,8 @@ def calc_transition_prob(label1, label2, res_corr_info):
146147
return 0
147148
difference_labels = label2.subtract(label1)
148149
if res_corr_info.do_correction:
149-
trans_prob = rc.calc_indirect_overlap_prob(label1, label2, res_corr_info)
150+
trans_prob = rc.calc_indirect_overlap_prob(
151+
label1, label2, res_corr_info)
150152
else: # Without resolution correction
151153
trans_prob = ip.calc_label_diff_prob(label1, difference_labels)
152154
return trans_prob

0 commit comments

Comments
 (0)