InMemoryDatasetHandle¶
- class lsst.pipe.base.InMemoryDatasetHandle(inMemoryDataset: Any, *, storageClass: StorageClass | str | None = None, parameters: dict[str, Any] | None = None, dataId: DataCoordinate | Mapping[str, Any] | None = None, copy: bool = False, **kwargs: Any)¶
- Bases: - object- An in-memory version of a - DeferredDatasetHandle.- Parameters:
- inMemoryDatasetAny
- The dataset to be used by this handle. 
- storageClassStorageClassorNone, optional
- The storage class associated with the in-memory dataset. If - Noneand if a storage class is needed, an attempt will be made to work one out from the underlying python type.
- parametersdict[str,Any]
- Parameters to be used with - get.
- dataIdDataIdorNone, optional
- The dataId associated with this dataset. Only used for compatibility with the Butler implementation. Can be used for logging messages by calling code. If - dataIdis not specified, a default empty dataId will be constructed.
- copybool, optional
- Whether to copy on - getor not.
- **kwargsAny
- If - kwargsare provided without specifying a- dataId, those parameters will be converted into a dataId-like entity.
 
- inMemoryDataset
 - Attributes Summary - Control whether a copy of the in-memory dataset is returned for every call to - get().- Optional parameters that may be used to specify a subset of the dataset to be loaded ( - dictor- None).- The name of the - StorageClassassociated with this dataset.- Methods Summary - get(*[, component, parameters, storageClass])- Retrieve the dataset pointed to by this handle. - Attributes Documentation - copy: bool = False¶
- Control whether a copy of the in-memory dataset is returned for every call to - get().
 - parameters: dict | None = None¶
- Optional parameters that may be used to specify a subset of the dataset to be loaded ( - dictor- None).
 - storageClass: StorageClass | str | None = None¶
- The name of the - StorageClassassociated with this dataset.- If - None, the storage class will be looked up from the factory.
 - Methods Documentation - get(*, component: str | None = None, parameters: dict | None = None, storageClass: str | StorageClass | None = None) Any¶
- Retrieve the dataset pointed to by this handle. - This handle may be used multiple times, possibly with different parameters. - Parameters:
- componentstror 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. 
- parametersdictor None
- The parameters argument will be passed to the butler get method. It defaults to - None. If the value is not- None, this- dictwill be merged with the parameters dict used to construct the- DeferredDatasetHandleclass.
- storageClassStorageClassorstr, 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 - StorageClasscan force a different type to be returned. This type must be compatible with the original type.
 
- component
- Returns:
- returnobject
- The dataset pointed to by this handle. Whether this returns the original object or a copy is controlled by the - copyproperty of the handle that is set at handle construction time. If the stored object is- Nonethis method always returns- Noneregardless of any component request or parameters.
 
- return
- Raises:
- KeyError
- Raised if a component or parameters are used but no storage class can be found.