RepoExport¶
-
class
lsst.daf.butler.RepoExport(registry: Registry, datastore: Datastore, backend: RepoExportBackend, *, directory: Optional[str] = None, transfer: Optional[str] = None)¶ Bases:
objectPublic interface for exporting a subset of a data repository.
Instances of this class are obtained by calling
Butler.exportas the value returned by that context manager:with butler.export(filename="export.yaml") as export: export.saveDataIds(...) export.saveDatasts(...)
- Parameters
- registry
Registry Registry to export from.
- datastore
Datastore Datastore to export from.
- backend
RepoExportBackend Implementation class for a particular export file format.
- directory
str, optional Directory to pass to
Datastore.export.- transfer
str, optional Transfer mdoe to pass to
Datastore.export.
- registry
Methods Summary
saveDataIds(dataIds, *[, elements])Export the dimension records associated with one or more data IDs.
saveDatasets(refs, *[, elements, rewrite])Export one or more datasets.
Methods Documentation
-
saveDataIds(dataIds: Iterable[ExpandedDataCoordinate], *, elements: Optional[Iterable[DimensionElement]] = None)¶ Export the dimension records associated with one or more data IDs.
- Parameters
- dataIdsiterable of
ExpandedDataCoordinate. Fully-expanded data IDs to export.
- elementsiterable of
DimensionElement, optional Dimension elements whose records should be exported. If
None, records for all dimensions will be exported.
- dataIdsiterable of
-
saveDatasets(refs: Iterable[DatasetRef], *, elements: Optional[Iterable[DimensionElement]] = None, rewrite: Optional[Callable[[FileDataset], FileDataset]] = None)¶ Export one or more datasets.
This automatically exports any
DatasetType,Run, and dimension records associated with the datasets.- Parameters
- refsiterable of
DatasetRef References to the datasets to export. Their
DatasetRef.idattributes must not beNone. Duplicates are automatically ignored.- elementsiterable of
DimensionElement, optional Dimension elements whose records should be exported; this is forwarded to
saveDataIdswhen exporting the data IDs of the given datasets.- rewritecallable, optional
A callable that takes a single
FileDatasetargument and returns a modifiedFileDataset. This is typically used to rewrite the path generated by the datastore. IfNone, theFileDatasetreturned byDatastore.exportwill be used directly.
- refsiterable of