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: BaseQuantumGraphReader

A helper class for reading predicted quantum graphs.

Attributes Summary

address_reader

A helper object for reading addresses into the multi-block files.

components

Quantum graph components populated by this reader's methods.

decompressor

A decompressor for all compressed JSON blocks.

header

Header metadata for the quantum graph.

page_size

Approximate number of bytes to read at a time.

pipeline_graph

Graph of tasks and dataset type names that appear in the quantum graph.

zf

The zip archive that represents the quantum graph on disk.

Methods Summary

finish()

Construct a PredictedQuantumGraph instance from this reader.

open(uri, *[, page_size, import_mode])

Construct a reader from a URI.

read_all()

Read all components in full.

read_dimension_data()

Read all dimension records.

read_execution_quanta([quantum_ids])

Read all information needed to execute the given quanta.

read_init_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_thin_graph()

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 PredictedQuantumGraph instance 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 .qg extension.

page_sizeint, 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_modepipeline_graph.TaskImportMode, optional

How to handle importing the task classes referenced in the pipeline graph.

Returns#

readercontextlib.AbstractContextManager [ PredictedQuantumGraphReader ]

A context manager that returns the reader when entered.

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_idsIterable [ 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.

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_idsIterable [ 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.

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.