StorageClass¶
-
class
lsst.daf.butler.StorageClass(name=None, pytype=None, components=None, parameters=None, assembler=None)¶ Bases:
objectClass describing how a label maps to a particular Python type.
- Parameters
- name
str Name to use for this class.
- pytype
type Python type (or name of type) to associate with the
StorageClass- components
dict, optional dictmapping name of a component to anotherStorageClass.- parameters
SequenceorSet Parameters understood by this
StorageClass.- assembler
str, optional Fully qualified name of class supporting assembly and disassembly of a
pytypeinstance.
- name
Attributes Summary
Class to use to (dis)assemble an object from components.
Component names mapped to associated
StorageClasssetof names of parameters supported by thisStorageClassPython type associated with this
StorageClass.Methods Summary
Return an instance of an assembler.
filterParameters(parameters[, subset])Filter out parameters that are not known to this StorageClass
Boolean indicating whether this
StorageClassis a composite or not.Return set of all parameters known to this
StorageClassvalidateInstance(instance)Check that the supplied Python object has the expected Python type
validateParameters([parameters])Check that the parameters are known to this
StorageClassAttributes Documentation
-
assemblerClass¶ Class to use to (dis)assemble an object from components.
-
components¶ Component names mapped to associated
StorageClass
-
defaultAssemblerName= 'lsst.daf.butler.core.assembler.CompositeAssembler'¶
-
parameters¶ setof names of parameters supported by thisStorageClass
-
pytype¶ Python type associated with this
StorageClass.
Methods Documentation
-
assembler()¶ Return an instance of an assembler.
- Returns
- assembler
CompositeAssembler Instance of the assembler associated with this
StorageClass. Assembler is constructed with thisStorageClass.
- assembler
- Raises
- TypeError
This StorageClass has no associated assembler.
-
filterParameters(parameters, subset=None)¶ Filter out parameters that are not known to this StorageClass
- Parameters
- parameters
dict, optional Candidate parameters. Can be
Noneif no parameters have been provided.- subset
Collection, optional Subset of supported parameters that the caller is interested in using. The subset must be known to the
StorageClassif specified.
- parameters
- Returns
-
isComposite()¶ Boolean indicating whether this
StorageClassis a composite or not.- Returns
- isComposite
bool Trueif thisStorageClassis a composite,Falseotherwise.
- isComposite
-
knownParameters()¶ Return set of all parameters known to this
StorageClassThe set includes parameters understood by components of a composite.
- Returns
- known
set All parameter keys of this
StorageClassand the component storage classes.
- known
-
validateInstance(instance)¶ Check that the supplied Python object has the expected Python type
- Parameters
- instance
object Object to check.
- instance
- Returns
- isOk
bool True if the supplied instance object can be handled by this
StorageClass, False otherwise.
- isOk
-
validateParameters(parameters=None)¶ Check that the parameters are known to this
StorageClassDoes not check the values.
- Parameters
- parameters
Collection, optional Collection containing the parameters. Can be
dict-like orset-like. The parameter values are not checked. If no parameters are supplied, always returns without error.
- parameters
- Raises
- KeyError
Some parameters are not understood by this
StorageClass.