Skip to content

Commit 4337d22

Browse files
committed
fix error logs handling repeat RTs
1 parent c0f4dc5 commit 4337d22

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

corems/mass_spectra/input/rawFileReader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,8 @@ def get_error_logs(self):
992992
error_log_item = self.iRawDataPlus.GetErrorLogItem(i)
993993
rt = error_log_item.RetentionTime
994994
message = error_log_item.Message
995-
error_logs[rt] = message
995+
# Use the index `i` as the unique ID key
996+
error_logs[i] = {'rt': rt, 'message': message}
996997
return error_logs
997998

998999

tests/test_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def test_import_thermo_parse_metadata():
363363

364364
# Read the error logs
365365
error_logs = parser.get_error_logs()
366-
assert error_logs[0.0] == 'Activation type: ETD'
366+
assert error_logs[0]['message'] == 'm/z: 202.00000'
367367

368368
# Read the sample information
369369
sampleinfo = parser.get_sample_information()
@@ -372,4 +372,4 @@ def test_import_thermo_parse_metadata():
372372
# Close the file
373373
parser.close_file()
374374
assert parser.iRawDataPlus.get_IsOpen() == False
375-
375+

0 commit comments

Comments
 (0)