Skip to content

Commit

Permalink
chore: log when instrument model inference fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Aug 23, 2024
1 parent 5eabab9 commit 63bb08c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/io/mzml/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,7 @@ impl<
}

pub fn get_chromatogram_by_id(&mut self, id: &str) -> Option<Chromatogram> {
let offset_ref = self.chromatogram_index.get(id);
let offset = offset_ref.expect("Failed to retrieve offset");
let offset = self.chromatogram_index.get(id)?;
let start = self
.handle
.stream_position()
Expand All @@ -1486,8 +1485,7 @@ impl<
}

pub fn get_chromatogram_by_index(&mut self, index: usize) -> Option<Chromatogram> {
let offset_ref = self.chromatogram_index.get_index(index);
let (_key, offset) = offset_ref.expect("Failed to retrieve offset");
let (_key, offset) = self.chromatogram_index.get_index(index)?;
let start = self
.handle
.stream_position()
Expand Down
1 change: 1 addition & 0 deletions src/io/thermo/instruments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ pub fn parse_instrument_model(instrument_model: &str) -> InstrumentModelType {
return *model_enum;
}
}
log::debug!("Failed to infer instrument model from name string {instrument_model}");
InstrumentModelType::Unknown
}

Expand Down

0 comments on commit 63bb08c

Please sign in to comment.