PreExecInitBase

class lsst.ctrl.mpexec.PreExecInitBase(butler: LimitedButler, taskFactory: TaskFactory, extendRun: bool)

Bases: ABC

Common part of the implementation of PreExecInit classes that does not depend on Butler type.

Parameters:
butlerLimitedButler

Butler to use.

taskFactorylsst.pipe.base.TaskFactory

Ignored and accepted for backwards compatibility.

extendRunbool

Whether extend run parameter is in use.

Methods Summary

initialize(graph[, saveInitOutputs, ...])

Perform all initialization steps.

initializeDatasetTypes(graph[, ...])

Save or check DatasetTypes output by the tasks in a graph.

saveConfigs(graph)

Write configurations for pipeline tasks to butler or check that existing configurations are equal to the new ones.

saveInitOutputs(graph)

Write any datasets produced by initializing tasks in a graph.

savePackageVersions(graph)

Write versions of software packages to butler.

Methods Documentation

initialize(graph: QuantumGraph, saveInitOutputs: bool = True, registerDatasetTypes: bool = False, saveVersions: bool = True) None

Perform all initialization steps.

Convenience method to execute all initialization steps. Instead of calling this method and providing all options it is also possible to call methods individually.

Parameters:
graphQuantumGraph

Execution graph.

saveInitOutputsbool, optional

If True (default) then save “init outputs”, configurations, and package versions to butler.

registerDatasetTypesbool, optional

If True then register dataset types in registry, otherwise they must be already registered.

saveVersionsbool, optional

If False then do not save package versions even if saveInitOutputs is set to True.

abstract initializeDatasetTypes(graph: QuantumGraph, registerDatasetTypes: bool = False) None

Save or check DatasetTypes output by the tasks in a graph.

Iterates over all DatasetTypes for all tasks in a graph and either tries to add them to registry or compares them to existing ones.

Parameters:
graphQuantumGraph

Execution graph.

registerDatasetTypesbool, optional

If True then register dataset types in registry, otherwise they must be already registered.

Raises:
ValueError

Raised if existing DatasetType is different from DatasetType in a graph.

KeyError

Raised if registerDatasetTypes is False and DatasetType does not exist in registry.

saveConfigs(graph: QuantumGraph) None

Write configurations for pipeline tasks to butler or check that existing configurations are equal to the new ones.

Parameters:
graphQuantumGraph

Execution graph.

Raises:
lsst.daf.butler.registry.ConflictingDefinitionError

Raised if existing object in butler is different from new data, or if extendRun is False and datasets already exists. Content of a butler collection should not be changed if this exception is raised.

saveInitOutputs(graph: QuantumGraph) None

Write any datasets produced by initializing tasks in a graph.

Parameters:
graphQuantumGraph

Execution graph.

Raises:
TypeError

Raised if the type of existing object in butler is different from new data.

savePackageVersions(graph: QuantumGraph) None

Write versions of software packages to butler.

Parameters:
graphQuantumGraph

Execution graph.

Raises:
TypeError

Raised if existing object in butler is incompatible with new data.