DataUnitRegistry¶
-
class
lsst.daf.butler.DataUnitRegistry¶ Bases:
objectInstances of this class keep track of
DataUnitrelations.Entries in this
dict-like object representDataUnitinstances, keyed onDataUnitnames.Methods Summary
fromConfig(config[, builder])Alternative constructor. getByLinkName(name)Get a DataUnitfor whichnameis part of the link.getJoin(lhs, rhs)Return the DataUnitJoin that relates the given DataUnit names. getPrimaryKeyNames(dataUnitNames)Get all primary-key column names for the given dataUnitNames.getRegionHolder(*dataUnits)Return the DataUnit or DataUnitJoin that holds region for the given combination of DataUnits. items()keys()values()Methods Documentation
-
classmethod
fromConfig(config, builder=None)¶ Alternative constructor.
Build a
DataUnitRegistryinstance from aConfigobject and an (optional)SchemaBuilder.Parameters: - config :
SchemaConfig Registryschema configuration containing “DataUnits”, “dataUnitRegions”, and “dataUnitJoins” entries.- builder :
SchemaBuilder, optional When given, create
sqlalchemy.core.Tableentries for everyDataUnittable.
- config :
-
getByLinkName(name)¶ Get a
DataUnitfor whichnameis part of the link.Parameters: - name :
str Link name.
Returns: Raises: - KeyError
When the provided
namedoes not correspond to a link for any of theDataUnitentries in the registry.
- name :
-
getJoin(lhs, rhs)¶ Return the DataUnitJoin that relates the given DataUnit names.
While DataUnitJoins are associated with a specific ordering or lhs and rhs, this method tries both.
Parameters: Returns: - join :
DataUnitJoin The DataUnitJoin that relates the given DataUnits, or None.
- join :
-
getPrimaryKeyNames(dataUnitNames)¶ Get all primary-key column names for the given
dataUnitNames.Parameters: - dataUnitNames :
sequence A sequence of
DataUnitnames.
Returns: - primaryKeyNames :
set All primary-key column names for the given
dataUnitNames.
- dataUnitNames :
-
getRegionHolder(*dataUnits)¶ Return the DataUnit or DataUnitJoin that holds region for the given combination of DataUnits.
Arguments may be either DataUnit instances or their names (but not link names), and required dependencies may or may not be included. Optional dependencies must not be included.
Returned object can be either
DataUnitJoinorDataUnit. Usetableand/orregionColumnproperties of returned object to retrieve region data from database table.Returns: - `DataUnitJoin` or `DataUnit` instance.
Raises: - KeyError
Raised if there is no Region associated with the given combination of DataUnits.
-
items()¶
-
keys()¶
-
values()¶
-
classmethod