PredictedQuantumGraphReader#
- class lsst.pipe.base.quantum_graph.PredictedQuantumGraphReader(header: HeaderModel, pipeline_graph: PipelineGraph, zf: zipfile.ZipFile, decompressor: Decompressor, address_reader: AddressReader, page_size: int)#
Bases:
BaseQuantumGraphReaderA helper class for reading predicted quantum graphs.
Attributes Summary
A helper object for reading addresses into the multi-block files.
Quantum graph components populated by this reader's methods.
A decompressor for all compressed JSON blocks.
Header metadata for the quantum graph.
Approximate number of bytes to read at a time.
Graph of tasks and dataset type names that appear in the quantum graph.
The zip archive that represents the quantum graph on disk.
Methods Summary
finish()Construct a
PredictedQuantumGraphinstance from this reader.open(uri, *[, page_size, import_mode])Construct a reader from a URI.
read_all()Read all components in full.
Read all dimension records.
read_execution_quanta([quantum_ids])Read all information needed to execute the given quanta.
Read the list of special quanta that represent init-inputs and init-outputs.
read_quantum_datasets([quantum_ids])Read information about all datasets produced and consumed by the given quantum IDs.
Read the thin graph.
Attributes Documentation
- address_reader: AddressReader = <dataclasses._MISSING_TYPE object>#
A helper object for reading addresses into the multi-block files.
- components: PredictedQuantumGraphComponents = <dataclasses._MISSING_TYPE object>#
Quantum graph components populated by this reader’s methods.
- decompressor: Decompressor = <dataclasses._MISSING_TYPE object>#
A decompressor for all compressed JSON blocks.
- header: HeaderModel = <dataclasses._MISSING_TYPE object>#
Header metadata for the quantum graph.
- page_size: int = <dataclasses._MISSING_TYPE object>#
Approximate number of bytes to read at a time.
Note that this does not set a page size for all reads, but it does affect the smallest, most numerous reads.
- pipeline_graph: PipelineGraph = <dataclasses._MISSING_TYPE object>#
Graph of tasks and dataset type names that appear in the quantum graph.
- zf: zipfile.ZipFile = <dataclasses._MISSING_TYPE object>#
The zip archive that represents the quantum graph on disk.
Methods Documentation
- finish() PredictedQuantumGraph#
Construct a
PredictedQuantumGraphinstance from this reader.
- classmethod open(uri: str | ParseResult | ResourcePath | Path, *, page_size: int = 5000000, import_mode: TaskImportMode = TaskImportMode.ASSUME_CONSISTENT_EDGES) Iterator[PredictedQuantumGraphReader]#
Construct a reader from a URI.
Parameters#
- uriconvertible to
lsst.resources.ResourcePath URI to open. Should have a
.qgextension.- page_size
int, optional Approximate number of bytes to read at once from address files. Note that this does not set a page size for all reads, but it does affect the smallest, most numerous reads.
- import_mode
pipeline_graph.TaskImportMode, optional How to handle importing the task classes referenced in the pipeline graph.
Returns#
- reader
contextlib.AbstractContextManager[PredictedQuantumGraphReader] A context manager that returns the reader when entered.
- uriconvertible to
- read_all() None#
Read all components in full.
- read_dimension_data() None#
Read all dimension records.
Record data IDs will be immediately deserialized, while other fields will be left in serialized form until they are needed.
- read_execution_quanta(quantum_ids: Iterable[UUID] | None = None) None#
Read all information needed to execute the given quanta.
Parameters#
- quantum_ids
Iterable[uuid.UUID], optional Iterable of quantum IDs to load. If not provided, all quanta will be loaded. The UUIDs of special init quanta will be ignored.
- quantum_ids
- read_init_quanta() None#
Read the list of special quanta that represent init-inputs and init-outputs.
- read_quantum_datasets(quantum_ids: Iterable[UUID] | None = None) None#
Read information about all datasets produced and consumed by the given quantum IDs.
Parameters#
- quantum_ids
Iterable[uuid.UUID], optional Iterable of quantum IDs to load. If not provided, all quanta will be loaded. The UUIDs of special init quanta will be ignored.
- quantum_ids
- read_thin_graph() None#
Read the thin graph.
The thin graph is a quantum-quantum DAG with just task labels and data IDs as node attributes. It always includes all regular quanta, and does not include init-input or init-output information.