DatasetType¶
-
class
lsst.daf.butler.DatasetType(name, dimensions, storageClass)¶ Bases:
objectA named category of Datasets that defines how they are organized, related, and stored.
A concrete, final class whose instances represent
DatasetTypes.DatasetTypeinstances may be constructed without aRegistry, but they must be registered viaRegistry.registerDatasetType()before corresponding Datasets may be added.DatasetTypeinstances are immutable.Parameters: - name :
str A string name for the Dataset; must correspond to the same
DatasetTypeacross all Registries.- dimensions :
DimensionGraphor iterable ofstr Dimensions used to label and relate instances of this DatasetType, or string names thereof.
- storageClass :
StorageClassorstr Instance of a
StorageClassor name ofStorageClassthat defines how thisDatasetTypeis persisted.
Attributes Summary
dimensionsThe Dimensions that label and relate instances of thisDatasetType(DimensionGraphorDimensionNameSet).nameA string name for the Dataset; must correspond to the same DatasetTypeacross all Registries.storageClassStorageClassinstance that defines how thisDatasetTypeis persisted.Methods Summary
component()Component name (if defined) componentTypeName(component)Given a component name, derive the datasetTypeName of that component isComposite()Boolean indicating whether this DatasetTypeis a composite type.nameAndComponent()Return the root name of this dataset type and the component name (if defined). nameWithComponent(datasetTypeName, componentName)Form a valid DatasetTypeName from a parent and component. normalize(universe)Ensure the dimensions and storage class name are valid, and make self.dimensionsa trueDimensionGraphinstance if it isn’t already.splitDatasetTypeName(datasetTypeName)Given a dataset type name, return the root name and the component name. Attributes Documentation
-
dimensions¶ The
Dimensions that label and relate instances of thisDatasetType(DimensionGraphorDimensionNameSet).If this
DatasetTypewas not obtained from or registered with aRegistry, this will typically be aDimensionNameSet, with much less functionality (just an unsorted.namesand comparison operators) than a fullDimensionGraph.
-
name¶ A string name for the Dataset; must correspond to the same
DatasetTypeacross all Registries.
-
storageClass¶ StorageClassinstance that defines how thisDatasetTypeis persisted. Note that if DatasetType was constructed with a name of a StorageClass then Butler has to be initialized before using this property.
Methods Documentation
-
component()¶ Component name (if defined)
Returns: - comp :
str Name of component part of DatasetType name.
Noneif thisDatasetTypeis not associated with a component.
- comp :
-
componentTypeName(component)¶ Given a component name, derive the datasetTypeName of that component
Parameters: - component :
str Name of component
Returns: - derived :
str Compound name of this
DatasetTypeand the component.
Raises: - KeyError
Requested component is not supported by this
DatasetType.
- component :
-
isComposite()¶ Boolean indicating whether this
DatasetTypeis a composite type.Returns: - isComposite :
bool Trueif thisDatasetTypeis a composite type,Falseotherwise.
- isComposite :
-
nameAndComponent()¶ Return the root name of this dataset type and the component name (if defined).
Returns: - rootName :
str Root name for this
DatasetTypewithout any components.- componentName :
str The component if it has been specified, else
None.
- rootName :
-
static
nameWithComponent(datasetTypeName, componentName)¶ Form a valid DatasetTypeName from a parent and component.
No validation is performed.
Parameters: Returns: - compTypeName :
str Name to use for component DatasetType.
- compTypeName :
-
normalize(universe)¶ Ensure the dimensions and storage class name are valid, and make
self.dimensionsa trueDimensionGraphinstance if it isn’t already.Parameters: - universe :
DimensionGraph The set of all known dimensions.
Raises: - ValueError
Raised if the DatasetType is invalid, either because one or more dimensions in
self.dimensionsis not inuniverse, or the storage class name is not recognized.
- universe :
-
static
splitDatasetTypeName(datasetTypeName)¶ Given a dataset type name, return the root name and the component name.
Parameters: - datasetTypeName :
str The name of the dataset type, can include a component using a “.”-separator.
Returns: Notes
If the dataset type name is
a.b.cthis method will return a root name ofaand a component name ofb.c.- datasetTypeName :
- name :