Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`dilution_factor`, `user_labels`, `inst_method`, `proc_method`,
`file_name`, `path`). The Rust core already decoded this
(`RawFileReader::seq_row`); this exposes it to Python. (@Nabejo)
- `RawFile.error_log()` (Python): returns the acquisition error log as a
list of `{"time": ..., "message": ...}` dicts, in log order (`time` is
the acquisition-relative time in minutes). The Rust core already decoded
this (`RawFileReader::error_log`); this exposes it to Python. (@Nabejo)

## [1.2.1] - 2026-07-06

Expand Down
17 changes: 17 additions & 0 deletions crates/opentfraw-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@ impl RawFile {
self.reader.scan_filter(scan_number)
}

/// Return the acquisition error log as a list of
/// ``{"time": ..., "message": ...}`` dicts, in log order.
///
/// ``time`` is the acquisition-relative time in minutes; ``message`` is
/// the instrument-reported error text. The Rust core already decodes
/// this (`RawFileReader::error_log`); this surfaces it to Python.
fn error_log<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyList>> {
let list = PyList::empty_bound(py);
for entry in &self.reader.error_log {
let d = PyDict::new_bound(py);
d.set_item("time", entry.time)?;
d.set_item("message", &entry.message)?;
list.append(d)?;
}
Ok(list)
}

/// Return the per-scan generic ("trailer") parameters for `scan_number` as
/// a ``{label: value}`` dict, or ``None`` if the scan has no parameter
/// record. Mirrors the vendor reader's trailer-extra information: keys are
Expand Down
Loading