FakeDatasetRef

class lsst.daf.butler.registry.interfaces.FakeDatasetRef

Bases: object

A fake DatasetRef that can be used internally by butler where only the dataset ID is available.

Should only be used when registry can not be used to create a full DatasetRef from the ID. A particular use case is during dataset deletion when solely the ID is available.

Parameters:
id : int

The dataset ID.

Attributes Summary

components
datasetType
id Unique integer that identifies this dataset.

Methods Summary

allRefs(parents) Return all the nested component DatasetRef and optionally the parent.
flatten(refs, *, parents) Recursively transform an iterable over FakeDatasetRef to include nested component FakeDatasetRef instances.
getCheckedId() Return self.id.

Attributes Documentation

components
datasetType
id

Unique integer that identifies this dataset.

Methods Documentation

allRefs(parents: bool = True) → Iterator[lsst.daf.butler.registry.interfaces._bridge.FakeDatasetRef]

Return all the nested component DatasetRef and optionally the parent.

Parameters:
parents : bool, optional

If True (default) include the given datasets in the output iterable. If False, include only their components. Since a FakeDatasetRef never have components, setting this to False will yield no results.

Yields:
ref : FakeDatasetRef

Since there are never components, this will either return itself or no results (depending on the value of parents).

static flatten(refs: Iterable[lsst.daf.butler.registry.interfaces._bridge.FakeDatasetRef], *, parents: bool = True) → Iterator[lsst.daf.butler.registry.interfaces._bridge.FakeDatasetRef]

Recursively transform an iterable over FakeDatasetRef to include nested component FakeDatasetRef instances.

Parameters:
refs : Iterable [ FakeDatasetRef ]

Input iterable to process.

parents : bool, optional

If True (default) include the given datasets in the output iterable. If False, include only their components, which for FakeDatasetRef means no results.

Yields:
ref : DatasetRef

Either one of the given FakeDatasetRef instances (only if parent is True) or one of its (recursive) children.

Notes

If parents is True, components are guaranteed to be yielded before their parents.

getCheckedId() → int

Return self.id.

This trivial method exists for compatibility with DatasetRef, for which checking is actually done.

Returns:
id : int

self.id.