StorageClass¶
-
class
lsst.daf.butler.StorageClass(name: Optional[str] = None, pytype: Union[Type[CT_co], str, None] = None, components: Optional[Dict[str, lsst.daf.butler.core.storageClass.StorageClass]] = None, derivedComponents: Optional[Dict[str, lsst.daf.butler.core.storageClass.StorageClass]] = None, parameters: Union[Sequence[T_co], Set[T], None] = None, delegate: Optional[str] = None)¶ Bases:
objectClass describing how a label maps to a particular Python type.
Parameters: - name :
str Name to use for this class.
- pytype :
typeorstr Python type (or name of type) to associate with the
StorageClass- components :
dict, optional dictmapping name of a component to anotherStorageClass.- derivedComponents :
dict, optional dictmapping name of a derived component to anotherStorageClass.- parameters :
SequenceorSet Parameters understood by this
StorageClassthat can control reading of data from datastores.- delegate :
str, optional Fully qualified name of class supporting assembly and disassembly of a
pytypeinstance.
Attributes Summary
componentsComponent names mapped to associated StorageClassdefaultDelegateNamedelegateClassClass to use to delegate type-specific actions. derivedComponentsDerived component names mapped to associated StorageClassparameterssetof names of parameters supported by thisStorageClasspytypePython type associated with this StorageClass.Methods Summary
allComponents()Return a mapping of all the derived and read/write components to the corresponding storage class. delegate()Return an instance of a storage class delegate. filterParameters(parameters, Any], subset)Filter out parameters that are not known to this StorageClass isComposite()Boolean indicating whether this StorageClassis a composite or not.knownParameters()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
-
components¶ Component names mapped to associated
StorageClass
-
defaultDelegateName= 'lsst.daf.butler.core.storageClassDelegate.StorageClassDelegate'¶
-
delegateClass¶ Class to use to delegate type-specific actions.
-
derivedComponents¶ Derived component names mapped to associated
StorageClass
-
parameters¶ setof names of parameters supported by thisStorageClass
-
pytype¶ Python type associated with this
StorageClass.
Methods Documentation
-
allComponents() → Mapping[str, lsst.daf.butler.core.storageClass.StorageClass]¶ Return a mapping of all the derived and read/write components to the corresponding storage class.
Returns: - comp :
dictof [str,StorageClass] The component name to storage class mapping.
- comp :
-
delegate() → lsst.daf.butler.core.storageClassDelegate.StorageClassDelegate¶ Return an instance of a storage class delegate.
Returns: - delegate :
StorageClassDelegate Instance of the delegate associated with this
StorageClass. The delegate is constructed with thisStorageClass.
Raises: - TypeError
This StorageClass has no associated delegate.
- delegate :
-
filterParameters(parameters: Dict[str, Any], subset: Optional[Collection[T_co]] = None) → Dict[str, Any]¶ 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. IfNonethe supplied parameters will all be checked, else only the keys in this set will be checked.
Returns: Raises: - ValueError
Raised if the provided subset is not a subset of the supported parameters or if it is an empty set.
- parameters :
-
isComposite() → bool¶ Boolean indicating whether this
StorageClassis a composite or not.Returns: - isComposite :
bool Trueif thisStorageClassis a composite,Falseotherwise.
- isComposite :
-
knownParameters() → Set[str]¶ 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: Any) → bool¶ Check that the supplied Python object has the expected Python type
Parameters: - instance :
object Object to check.
Returns: - isOk :
bool True if the supplied instance object can be handled by this
StorageClass, False otherwise.
- instance :
-
validateParameters(parameters: Optional[Collection[T_co]] = None) → 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.
Raises: - KeyError
Some parameters are not understood by this
StorageClass.
- parameters :
- name :