lsst.dax.apdb gd2a12a3803+0c2c227a2b
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
lsst.dax.apdb.versionTuple.VersionTuple Class Reference
Inheritance diagram for lsst.dax.apdb.versionTuple.VersionTuple:

Public Member Functions

VersionTuple fromString (cls, str versionStr)
 
bool checkCompatibility (self, VersionTuple database_version, bool update)
 
str __str__ (self)
 

Static Public Attributes

int major
 
int minor
 
int patch
 

Detailed Description

Class representing a version number.

Parameters
----------
major, minor, patch : `int`
    Version number components

Member Function Documentation

◆ __str__()

str lsst.dax.apdb.versionTuple.VersionTuple.__str__ ( self)
Transform version tuple into a canonical string form.

◆ checkCompatibility()

bool lsst.dax.apdb.versionTuple.VersionTuple.checkCompatibility ( self,
VersionTuple database_version,
bool update )
Compare implementation schema version with schema version in
database.

Parameters
----------
database_version : `VersionTuple`
    Version of the database schema.
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.

◆ fromString()

VersionTuple lsst.dax.apdb.versionTuple.VersionTuple.fromString ( cls,
str versionStr )
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.

The documentation for this class was generated from the following file: