forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCoreModuleEntry.cpp
More file actions
75 lines (60 loc) · 2.03 KB
/
CoreModuleEntry.cpp
File metadata and controls
75 lines (60 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#include "Acts/ActsVersion.hpp"
#include "ActsPython/Utilities/Helpers.hpp"
#include <pybind11/pybind11.h>
namespace py = pybind11;
/// This adds the core module entries to the Python module
/// There is a certain order necessary as py::class_ definitions
/// need to be registered before they can be used in other modules.
namespace ActsPython {
void addDefinitions(py::module_& m);
void addEventData(py::module_& m);
void addMagneticField(py::module_& m);
void addUtilities(py::module_& m);
void addVisualization(py::module_& m);
void addMaterial(py::module_& m);
void addSurfaces(py::module_& m);
void addGeometry(py::module_& m);
void addGeometryGen1(py::module_& m);
void addGeometryGen3(py::module_& m);
void addNavigation(py::module_& m);
void addPropagation(py::module_& m);
void addSeeding(py::module_& mt);
void addTrackFinding(py::module_& m);
} // namespace ActsPython
namespace py = pybind11;
PYBIND11_MODULE(ActsPythonBindings, m) {
using namespace ActsPython;
m.doc() = "Acts";
m.attr("__version__") =
std::tuple{Acts::VersionMajor, Acts::VersionMinor, Acts::VersionPatch};
{
auto mv = m.def_submodule("version");
mv.attr("major") = Acts::VersionMajor;
mv.attr("minor") = Acts::VersionMinor;
mv.attr("patch") = Acts::VersionPatch;
mv.attr("commit_hash") = std::string{Acts::CommitHash.value_or("UNKNOWN")};
mv.attr("commit_hash_short") =
std::string{Acts::CommitHashShort.value_or("UNKNOWN")};
}
addDefinitions(m);
addMagneticField(m);
addMaterial(m);
addUtilities(m);
addVisualization(m);
addSurfaces(m);
addGeometry(m);
addEventData(m);
addGeometryGen1(m);
addGeometryGen3(m);
addNavigation(m);
addPropagation(m);
addSeeding(m);
addTrackFinding(m);
}