InMemoryDatasetHandle

class lsst.pipe.base.InMemoryDatasetHandle(inMemoryDataset: Any, storageClass: Optional[str, None] = None, parameters: Optional[dict, None] = None, dataId: lsst.daf.butler.core.dimensions._coordinate.DataCoordinate = <factory>)

Bases: object

An in-memory version of a DeferredDatasetHandle.

Attributes Summary

parameters Optional parameters that may be used to specify a subset of the dataset to be loaded (dict or None).
storageClass The name of the StorageClass associated with this dataset.

Methods Summary

get(*, component, None] = None, parameters, …) Retrieves the dataset pointed to by this handle

Attributes Documentation

parameters = None

Optional parameters that may be used to specify a subset of the dataset to be loaded (dict or None).

storageClass = None

The name of the StorageClass associated with this dataset.

If None, the storage class will be looked up from the factory.

Methods Documentation

get(*, component: Optional[str, None] = None, parameters: Optional[dict, None] = None, storageClass: Union[str, lsst.daf.butler.core.storageClass.StorageClass, None] = None, **kwargs) → Any

Retrieves the dataset pointed to by this handle

This handle may be used multiple times, possibly with different parameters.

Parameters:
component : str or None

If the deferred object is a component dataset type, this parameter may specify the name of the component to use in the get operation.

parameters : dict or None

The parameters argument will be passed to the butler get method. It defaults to None. If the value is not None, this dict will be merged with the parameters dict used to construct the DeferredDatasetHandle class.

storageClass : StorageClass or str, optional

The storage class to be used to override the Python type returned by this method. By default the returned type matches the type stored. Specifying a read StorageClass can force a different type to be returned. This type must be compatible with the original type.

**kwargs

This argument is deprecated and only exists to support legacy gen2 butler code during migration. It is completely ignored and will be removed in the future.

Returns:
return : object

The dataset pointed to by this handle. This is the actual object that was initially stored and not a copy. Modifying this object will modify the stored object. If the stored object is None this method always returns None regardless of any component request or parameters.

Raises:
KeyError

Raised if a component or parameters are used but no storage class can be found.