Mantid
Loading...
Searching...
No Matches
MantidVersion.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7
8#include <boost/python/class.hpp>
9#include <boost/python/def.hpp>
10#include <boost/python/docstring_options.hpp>
11#include <boost/python/make_function.hpp>
12#include <boost/python/module.hpp>
13#include <boost/python/type_id.hpp>
14
16
17using namespace boost::python;
19
20namespace {
21
22std::string getMajor(const MantidVersion::VersionInfo &self) { return self.major; }
23
24std::string getMinor(const MantidVersion::VersionInfo &self) { return self.minor; }
25
26std::string getPatch(const MantidVersion::VersionInfo &self) { return self.patch; }
27
28std::string getStr(const MantidVersion::VersionInfo &self) { return self.major + "." + self.minor + "." + self.patch; }
29
30} // namespace
31
33
34 class_<MantidVersion::VersionInfo>("VersionInfo")
35 .add_property("major", make_function(&getMajor), "The major release version")
36 .add_property("minor", make_function(&getMinor), "The minor release version")
37 .add_property("patch", make_function(&getPatch), "The patch release version")
38 .def("__str__", make_function(&getStr), "The version in the standard form: Maj.Min.Pat");
39
41 "Returns the Mantid version string in the form \"major.minor.patch\"");
43 "Returns a data structure containing the major, minor, and patch parts of the version.");
44 def("release_notes_url", &Mantid::Kernel::MantidVersion::releaseNotes,
45 "Returns the url to the most applicable release notes");
46 def("revision", &Mantid::Kernel::MantidVersion::revision, "Returns the abbreviated SHA-1 of the last commit");
47 def("revision_full", &Mantid::Kernel::MantidVersion::revisionFull, "Returns the full SHA-1 of the last commit");
48 def("release_date", &Mantid::Kernel::MantidVersion::releaseDate, "Returns the date of the last commit");
49 def("doi", &Mantid::Kernel::MantidVersion::doi, "Returns the DOI for this release of Mantid");
50 def("paper_citation", &Mantid::Kernel::MantidVersion::paperCitation, "Returns The citation for the Mantid paper");
51}
void export_MantidVersion()
Class containing static methods to return the Mantid version number and date.
Definition: MantidVersion.h:21
static const VersionInfo versionInfo()
A data structure containing the full version info.
static const char * version()
The full version number.
static std::string doi()
The DOI for this release of Mantid.
static std::string releaseNotes()
The url to the most applicable release notes.
static std::string paperCitation()
The citation for the Mantid paper.
static const char * revisionFull()
The full SHA-1 of the last commit.
static const char * releaseDate()
The date of the last commit.
static const char * revision()
The abbreviated SHA-1 of the last commit.