Check out the Hyperspy Workshop May 13-17, 2024 Online

Version#

class pyxem.utils.diffraction.Version(version: str)#

Bases: _BaseVersion

This class abstracts handling of a project’s versions.

A Version instance is comparison aware and can be compared and sorted using the standard Python interfaces.

>>> v1 = Version("1.0a5")
>>> v2 = Version("1.0")
>>> v1
<Version('1.0a5')>
>>> v2
<Version('1.0')>
>>> v1 < v2
True
>>> v1 == v2
False
>>> v1 > v2
False
>>> v1 >= v2
False
>>> v1 <= v2
True

Attributes

Version.base_version

The "base version" of the version.

Version.dev

The development number of the version.

Version.epoch

The epoch of the version.

Version.is_devrelease

Whether this version is a development release.

Version.is_postrelease

Whether this version is a post-release.

Version.is_prerelease

Whether this version is a pre-release.

Version.local

The local version segment of the version.

Version.major

The first item of release or 0 if unavailable.

Version.micro

The third item of release or 0 if unavailable.

Version.minor

The second item of release or 0 if unavailable.

Version.post

The post-release number of the version.

Version.pre

The pre-release segment of the version.

Version.public

The public portion of the version.

Version.release

The components of the "release" segment of the version.

Methods