RepoExport¶
- 
class lsst.daf.butler.RepoExport(registry: Registry, datastore: Datastore, backend: RepoExportBackend, *, directory: Optional[str] = None, transfer: Optional[str] = None)¶
- Bases: - object- Public 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.
 - 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) → None¶
- Export the dimension records associated with one or more data IDs. - Parameters: - dataIds : iterable of ExpandedDataCoordinate.
- Fully-expanded data IDs to export. 
- elements : iterable of DimensionElement, optional
- Dimension elements whose records should be exported. If - None, records for all dimensions will be exported.
 
- dataIds : iterable of 
 - 
saveDatasets(refs: Iterable[DatasetRef], *, elements: Optional[Iterable[DimensionElement]] = None, rewrite: Optional[Callable[[FileDataset], FileDataset]] = None) → None¶
- Export one or more datasets. - This automatically exports any - DatasetType,- Run, and dimension records associated with the datasets.- Parameters: - refs : iterable of DatasetRef
- References to the datasets to export. Their - DatasetRef.idattributes must not be- None. Duplicates are automatically ignored. Nested data IDs must be- ExpandedDataCoordinateinstances.
- elements : iterable of DimensionElement, optional
- Dimension elements whose records should be exported; this is forwarded to - saveDataIdswhen exporting the data IDs of the given datasets.
- rewrite : callable, optional
- A callable that takes a single - FileDatasetargument and returns a modified- FileDataset. This is typically used to rewrite the path generated by the datastore. If- None, the- FileDatasetreturned by- Datastore.exportwill be used directly.
 - Notes - At present, this only associates datasets with the collection that matches their run name. Other collections will be included in the export in the future (once - Registryprovides a way to look up that information).
- refs : iterable of 
 
- registry :