Dimension

class lsst.daf.butler.Dimension(name: str, *, uniqueKeys: Iterable[lsst.daf.butler.core.schema.FieldSpec], **kwds)

Bases: lsst.daf.butler.DimensionElement

A named data-organization concept that can be used as a key in a data ID.

Parameters
namestr

Name of the dimension. Used as at least part of the table name, if the dimension in associated with a database table, and as an alternate key (instead of the instance itself) in data IDs.

uniqueKeysiterable of FieldSpec

Fields that can each be used to uniquely identify this dimension (once all required dependencies are also identified). The first entry will be used as the table’s primary key and as a foriegn key field in the fields of dependent tables.

kwds

Additional keyword arguments are forwarded to the DimensionElement constructor.

Methods Summary

hasTable()

Return True if this element is associated with a table (even if that table “belongs” to another element).

makeTableSpec()

Return a specification of the schema for the table corresponding to this 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.

makeTableSpec() → Optional[lsst.daf.butler.core.schema.TableSpec]

Return a specification of the schema for the table corresponding to this element.

This programmatically generates the primary and foreign key fields from the element’s dependencies and then appends any metadata fields.

Returns
specTableSpec or None

Database-agnostic specification of the fields in this table.