ctlearn package
Submodules
ctlearn.data_loader module
ctlearn.output_handler module
ctlearn.run_model module
ctlearn.utils module
ctlearn.version module
Get version identification from git.
The update_release_version() function writes the current version to the VERSION file. This function should be called before packaging a release version.
Use the get_version() function to get the version string, including the latest commit, from git. If git is not available the VERSION file will be read.
Heres an example of such a version string:
v0.2.0.post58+git57440dc
This script was taken from here: https://github.com/cta-observatory/ctapipe/blob/master/ctapipe/version.py
but the original code comes from here: https://github.com/aebrahim/python-git-version
Combining ideas from http://blogs.nopcode.org/brainstorm/2013/05/20/pragmatic-python-versioning-via-setuptools-and-git-tags/ and Python Versioneer https://github.com/warner/python-versioneer but being much more lightwheight
- ctlearn.version.get_version(pep440=False)[source]
Tracks the version number.
- pep440: bool
When True, this function returns a version string suitable for a release as defined by PEP 440. When False, the githash (if available) will be appended to the version string.
The file VERSION holds the version information. If this is not a git repository, then it is reasonable to assume that the version is not being incremented and the version returned will be the release version as read from the file.
However, if the script is located within an active git repository, git-describe is used to get the version information.
The file VERSION will need to be changed manually.