VersionTuple#

class lsst.dax.apdb.VersionTuple(major: int, minor: int, patch: int)#

Bases: NamedTuple

Class representing a version number.

Parameters#

major, minor, patchint

Version number components

Attributes Summary

major

Alias for field number 0

minor

Alias for field number 1

patch

Alias for field number 2

Methods Summary

checkCompatibility(database_version)

Compare implementation schema version with schema version in database.

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(database_version: VersionTuple) bool#

Compare implementation schema version with schema version in database.

Parameters#

database_versionVersionTuple

Version of the database schema.

Returns#

compatiblebool

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 and write schema made by older version; older version can neither read nor write into newer schema;

  • otherwise, different patch versions are totally compatible.

classmethod fromString(versionStr: str) VersionTuple#

Extract version number from a string.

Parameters#

versionStrstr

Version number in string form “X.Y.Z”, all components must be present.

Returns#

versionVersionTuple

Parsed version tuple.

Raises#

ValueError

Raised if string has an invalid format.