imaging_dataset
Progress events for a preprocessing pass over an imaging dataset.
Classes
ImagingDatasetEventReporter
class ImagingDatasetEventReporter( sender: ProgressEventSender | None, *, dataset_id: str, dataset_owner_id: str, preprocessing_id: str, start_sequence_number: int = 0,):Reports the progress of one preprocessing pass over an imaging dataset.
Arguments
sender: Delivers the events. None makes the reporter a no-op.dataset_id: The dataset being preprocessed.dataset_owner_id: The username of the dataset's owner, which must be the user the sender authenticates as.preprocessing_id: The UUIDv7 identifying this preprocessing pass, fromuuid6.uuid7().start_sequence_number: The sequence number of the first event. A pass reported from more than one process continues from the previous reporter'snext_sequence_number.
Ancestors
Variables
next_sequence_number : int- The sequence number the next event will carry.
-
sender : ProgressEventSender | None- The sender this reporter hands its events to, if any.Read-only: a caller composing a second reporter for the same run shares this one rather than holding the sender separately.
Methods
error
def error(self, reason: LiteralString, exc: BaseException | None = None) ‑> None:Report that the preprocessing pass failed.
Arguments
reason: A fixed description of what failed. Must be a string literal, so no data can reach it.exc: The exception behind the failure. Only its class name is sent.
file_metadata_completed
def file_metadata_completed( self, files_processed_count: int, files_skipped_count: int, cache_entries_used_count: int = 0,) ‑> None:Report that the file metadata step has completed.
Arguments
files_processed_count: Files the step processed.files_skipped_count: Files the step skipped.cache_entries_used_count: Files answered from the cache.
file_metadata_started
def file_metadata_started(self, files_count: int) ‑> None:Report that the file metadata step has started.
Arguments
files_count: The number of files the step will look at.
preprocessing_started
def preprocessing_started( self, trigger: DatasetPreprocessingStartTrigger.ValueType,) ‑> None:Report that the preprocessing pass has started.
Arguments
trigger: What started the pass.
scan_metadata_completed
def scan_metadata_completed( self, files_processed_count: int, files_skipped_count: int, cache_entries_used_count: int = 0,) ‑> None:Report that the scan metadata step has completed.
Arguments
files_processed_count: Files the step processed.files_skipped_count: Files the step skipped.cache_entries_used_count: Files answered from the cache.
scan_metadata_started
def scan_metadata_started(self, files_count: int) ‑> None:Report that the scan metadata step has started.
Arguments
files_count: The number of files the step will look at.