VersionedExtension

class lsst.daf.butler.registry.interfaces.VersionedExtension

Bases: abc.ABC

Interface for extension classes with versions.

Methods Summary

currentVersion() Return extension version as defined by current implementation.
extensionName() Return full name of the extension.
schemaDigest() Return digest for schema piece managed by this extension.

Methods Documentation

classmethod currentVersion() → Optional[lsst.daf.butler.registry.interfaces._versioning.VersionTuple]

Return extension version as defined by current implementation.

This method can return None if an extension does not require its version to be saved or checked.

Returns:
version : VersionTuple

Current extension version or None.

classmethod extensionName() → str

Return full name of the extension.

This name should match the name defined in registry configuration. It is also stored in registry attributes. Default implementation returns full class name.

Returns:
name : str

Full extension name.

schemaDigest() → Optional[str]

Return digest for schema piece managed by this extension.

Returns:
digest : str or None

String representation of the digest of the schema, None should be returned if schema digest is not to be saved or checked. The length of the returned string cannot exceed the length of the “value” column of butler attributes table, currently 65535 characters.

Notes

There is no exact definition of digest format, any string should work. The only requirement for string contents is that it has to remain stable over time if schema does not change but it should produce different string for any change in the schema. In many cases default implementation in _defaultSchemaDigest can be used as a reasonable choice.