YamlRepoImportBackend

class lsst.daf.butler.YamlRepoImportBackend(stream: IO, registry: Registry)

Bases: RepoImportBackend

A repository import implementation that reads from a YAML file.

Parameters:
stream

A readable file-like object.

registryRegistry

The registry datasets will be imported into. Only used to retreive dataset types during construction; all write happen in register and load.

Methods Summary

load(datastore, *[, directory, transfer, ...])

Import information associated with the backend into the given registry and datastore.

register()

Register all runs and dataset types associated with the backend with the Registry the backend was constructed with.

Methods Documentation

load(datastore: Datastore | None, *, directory: str | None = None, transfer: str | None = None, skip_dimensions: Set | None = None, idGenerationMode: DatasetIdGenEnum = DatasetIdGenEnum.UNIQUE, reuseIds: bool = False) None

Import information associated with the backend into the given registry and datastore.

This must be run after register, and may be performed inside a transaction.

Parameters:
datastoreDatastore

Datastore to import into. If None, datasets will only be inserted into the Registry (primarily intended for tests).

directorystr, optional

File all dataset paths are relative to.

transferstr, optional

Transfer mode forwarded to Datastore.ingest.

skip_dimensionsset, optional

Dimensions that should be skipped and not imported. This can be useful when importing into a registry that already knows about a specific instrument.

idGenerationModeDatasetIdGenEnum, optional

Specifies option for generating dataset IDs when IDs are not provided or their type does not match backend type. By default unique IDs are generated for each inserted dataset.

reuseIdsbool, optional

If True then forces re-use of imported dataset IDs for integer IDs which are normally generated as auto-incremented. This option has no effect on the use of globally-unique IDs which are always re-used (or generated if integer IDs are being imported).

register() None

Register all runs and dataset types associated with the backend with the Registry the backend was constructed with.

These operations cannot be performed inside transactions, unlike those performed by load, and must in general be performed before load.