lsst.pipe.base  20.0.0-20-g67d4e31+36c51c22b3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pipe.base.shims.ShimDataRef Class Reference

Public Member Functions

def __init__ (self, butlerSubset, dataId)
 
def get (self, datasetType=None, **rest)
 
def put (self, obj, datasetType=None, doBackup=False, **rest)
 
def datasetExists (self, datasetType=None, write=False, **rest)
 
def getButler (self)
 

Public Attributes

 butlerSubset
 
 dataId
 

Static Public Attributes

float GENERATION = 2.5
 

Detailed Description

A shim for a Gen2 `~lsst.daf.persistence.ButlerDataRef` with a Gen3
`~lsst.daf.butler.Butler` backend.

Parameters
----------
butlerSubset : `ShimButlerSubset`
    ButlerSubset shim instance.  Sets the butler and default dataset type
    used by the Dataref.
dataId : `dict` or `~lsst.daf.butler.DataId`
    Generation 3 data ID associated with this reference.

Definition at line 224 of file shims.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.shims.ShimDataRef.__init__ (   self,
  butlerSubset,
  dataId 
)

Definition at line 241 of file shims.py.

Member Function Documentation

◆ datasetExists()

def lsst.pipe.base.shims.ShimDataRef.datasetExists (   self,
  datasetType = None,
  write = False,
**  rest 
)
Check whether a datataset exists in the repository.

Parameters
----------
datasetType : `str`, optional
    Name of the dataset type.  Defaults to the dataset type used to
    construct the `ShimButlerSubset`.
write : `bool`
    This option is provided for compatibility with
    `lsst.daf.persistence.ButlerDataRef`, but must be `False`.
rest
    Additional arguments forwarded to `ShimButler.datasetExists`.

Returns
-------
exists : `bool`
    `True` if the dataset is present in the repository, `False`
    otherwise.

Definition at line 290 of file shims.py.

◆ get()

def lsst.pipe.base.shims.ShimDataRef.get (   self,
  datasetType = None,
**  rest 
)
Retrieve a dataset.

Parameters
----------
datasetType : `str`, optional.
    Name of the dataset type.  Defaults to the dataset type used to
    construct the `ShimButlerSubset`.
rest
    Additional arguments forwarded to `ShimButler.get`.

Returns
-------
dataset
    Retrieved object.

Raises
------
`~lsst.daf.persistence.NoResults`
    Raised if the dataset does not exist.

Definition at line 245 of file shims.py.

◆ getButler()

def lsst.pipe.base.shims.ShimDataRef.getButler (   self)
Return the (shim) Butler used by this DataRef.

Definition at line 315 of file shims.py.

◆ put()

def lsst.pipe.base.shims.ShimDataRef.put (   self,
  obj,
  datasetType = None,
  doBackup = False,
**  rest 
)
Write a dataset.

Parameters
----------
obj
    Object to write.
datasetType : `str`, optional
    Name of the dataset type.  Defaults to the dataset type used to
    construct the `ShimButlerSubset`.
doBackup : `bool`
    This option is provided for compatibility with
    `lsst.daf.persistence.ButlerDataRef`, but must be `False`.
rest
    Additional arguments forwarded to `ShimButler.put`.

Definition at line 270 of file shims.py.

Member Data Documentation

◆ butlerSubset

lsst.pipe.base.shims.ShimDataRef.butlerSubset

Definition at line 242 of file shims.py.

◆ dataId

lsst.pipe.base.shims.ShimDataRef.dataId

Definition at line 243 of file shims.py.

◆ GENERATION

float lsst.pipe.base.shims.ShimDataRef.GENERATION = 2.5
static

Definition at line 237 of file shims.py.


The documentation for this class was generated from the following file: