BaseIdGeneratorConfig#

class lsst.meas.base.BaseIdGeneratorConfig(*args, **kw)#

Bases: Config

Base class for configuration of IdGenerator instances.

This class is abstract (it cannot use abc.ABCMeta due to a metaclass conflict), and it should mostly be considered an implementation detail of how the attributes it defines are included in its concrete derived classes. Derived classes must implemented _make_dimension_packer.

See IdGenerator for usage.

Attributes Summary

n_releases

Number of (contiguous, starting from zero) release_id values to reserve space for.

release_id

Identifier for a data release or other version to embed in generated IDs.

Methods Summary

apply(data_id, **kwargs)

Construct an IdGenerator instance from this configuration.

make_field([doc])

Return a config field that holds an instance of this class.

Attributes Documentation

n_releases#

Number of (contiguous, starting from zero) release_id values to reserve space for. One (not zero) is used to reserve no space. (int, default 64)

release_id#

Identifier for a data release or other version to embed in generated IDs. Zero is reserved for IDs with no embedded release identifier. (int, default 0)

Methods Documentation

apply(data_id: DataCoordinate, **kwargs: Any) IdGenerator#

Construct an IdGenerator instance from this configuration.

Parameters#

data_idDataCoordinate

The data ID the IdGenerator will embed into all IDs. This generally must be a fully-expanded data ID (i.e. have dimension records attached), that identifies the “instrument” or “skymap” dimension, though this requirement may be relaxed for certain dimension packer types.

**kwargs

Additional keyword arguments are interpreted as dimension value pairs to include in the data ID. This may be used to provide constraints on dimensions for which records are not available.

Returns#

id_generatorIdGenerator

Object that generates integer IDs for catalogs and their rows by embedding the given data ID and a configurably-optional release ID.

Notes#

This method is called apply for consistency with the pattern of using lsst.pex.config.ConfigurableField and lsst.pex.config.RegistryField to construct the objects whose configuration they hold. It doesn’t actually use those mechanisms because we have many config classes for the one IdGenerator class, instead of the other way around, and as a result a “config as factory” approach works better.

classmethod make_field(doc='Configuration for how to generate catalog IDs from data IDs.')#

Return a config field that holds an instance of this class.

Parameters#

docstr, optional

Documentation for the config field. As this configuration almost always plays the same role in any parent config, the default is usually fine.

Returns#

fieldlsst.pex.config.ConfigField

New config field for instances of this class.

Notes#

This method is provided as a convenience to reduce boilerplate downstream: it typically saves an import or two, and it allows the same usually-appropriate docstring to be reused instead of rewritten each time. It does not need to be used in order to use this config class.