DimensionElement¶
-
class
lsst.daf.butler.
DimensionElement
(name: str, *, related: lsst.daf.butler.core.dimensions.elements.RelatedDimensions, metadata: Iterable[lsst.daf.butler.core.ddl.FieldSpec] = (), cached: bool = False, viewOf: Optional[str] = None, alwaysJoin: bool = False)¶ Bases:
object
A named data-organization concept that defines a label and/or metadata in the dimensions system.
A
DimensionElement
instance typically corresponds to a table in theRegistry
; the rows in that table are represented by instances of aDimensionRecord
subclass. MostDimensionElement
instances are instances of itsDimension
subclass, which is used for elements that can be used as data ID keys. The base class itself can be used for other dimension tables that provide metadata keyed by true dimensions.Parameters: - name :
str
Name of the element. Used as at least part of the table name, if the dimension in associated with a database table.
- related :
RelatedDimensions
Struct containing the names of related dimensions.
- metadata : iterable of
FieldSpec
Additional metadata fields included in this element’s table.
- cached :
bool
Whether
Registry
should cache records of this element in-memory.- viewOf :
str
, optional Name of another table this element’s records should be drawn from. The fields of this table must be a superset of the fields of the element.
Notes
DimensionElement
instances should always be constructed by and retreived from aDimensionUniverse
. They are immutable after they are fully constructed, and should never be copied.Pickling a
DimensionElement
just records its name and universe; unpickling one actually just looks up the element via the singleton dictionary of all universes. This allows pickle to be used to transfer elements between processes, but only when each process initializes its own instance of the sameDimensionUniverse
.Methods Summary
hasTable
()Return True
if this element is associated with a table (even if that table “belongs” to another element).Methods Documentation
-
hasTable
() → bool¶ Return
True
if this element is associated with a table (even if that table “belongs” to another element).Instances of the
DimensionElement
base class itself are always associated with tables.
- name :