Public Member Functions | |
| VersionTuple | fromString (cls, str versionStr) |
| bool | checkCompatibility (self, VersionTuple database_version) |
| str | __str__ (self) |
Class representing a version number.
Parameters
----------
major, minor, patch : `int`
Version number components
| str lsst.dax.apdb.versionTuple.VersionTuple.__str__ | ( | self | ) |
Transform version tuple into a canonical string form.
| bool lsst.dax.apdb.versionTuple.VersionTuple.checkCompatibility | ( | self, | |
| VersionTuple | database_version ) |
Compare implementation schema version with schema version in
database.
Parameters
----------
database_version : `VersionTuple`
Version of the database schema.
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 and write schema made by older version; older version can
neither read nor write into newer schema;
- otherwise, different patch versions are totally compatible.
| 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.