VersionTuple#
- class lsst.daf.butler.registry.interfaces.VersionTuple(major: int, minor: int, patch: int)#
Bases:
NamedTupleClass representing a version number.
Attributes#
- major
int Major version number.
- minor
int Minor version number.
- patch
int Patch level.
Attributes Summary
Methods Summary
checkCompatibility(registry_schema_version, ...)Compare implementation schema version with schema version in registry.
fromString(versionStr)Extract version number from a string.
Attributes Documentation
- major: int#
Alias for field number 0
- minor: int#
Alias for field number 1
- patch: int#
Alias for field number 2
Methods Documentation
- checkCompatibility(registry_schema_version: VersionTuple, update: bool) bool#
Compare implementation schema version with schema version in registry.
Parameters#
- registry_schema_version
VersionTuple Schema version that exists in registry or defined in a configuration for a registry to be created.
- update
bool If True then read-write access is expected.
Returns#
- compatible
bool True if schema versions are compatible.
Notes#
This method implements default rules for checking schema compatibility:
if major numbers differ, schemas are not compatible;
otherwise, if minor versions are different then newer version can read schema made by older version, but cannot write into it; older version can neither read nor write into newer schema;
otherwise, different patch versions are totally compatible.
Extensions that implement different versioning model will need to override their
VersionedExtension.checkCompatibilitymethod.- registry_schema_version
- classmethod fromString(versionStr: str) VersionTuple#
Extract version number from a string.
Parameters#
- versionStr
str Version number in string form “X.Y.Z”, all components must be present.
Returns#
- version
VersionTuple Parsed version tuple.
Raises#
- ValueError
Raised if string has an invalid format.
- versionStr
- major