19#include <pybind11/cast.h>
26 auto &m = root_module;
30 py::class_<UnitSystem>(m,
"UnitSystem")
32 py::init([](
f64 unit_time,
39 return std::make_unique<UnitSystem>(
49 py::arg(
"unit_time") = 1,
50 py::arg(
"unit_length") = 1,
51 py::arg(
"unit_mass") = 1,
52 py::arg(
"unit_current") = 1,
53 py::arg(
"unit_temperature") = 1,
54 py::arg(
"unit_qte") = 1,
55 py::arg(
"unit_lumint") = 1)
58 [](UnitSystem &self, std::string name,
i32 power, std::string pref) {
66 py::arg(
"pref") =
"None")
69 [](UnitSystem &self, std::string name,
i32 power, std::string pref) {
77 py::arg(
"pref") =
"None"
81 py::class_<shamunits::Constants<f64>>(m,
"Constants")
82 .def(py::init([](UnitSystem s) {
83 return std::make_unique<shamunits::Constants<f64>>(s);
91 return sycl::pown(cte.st(), power); \
#define UNITS_CONSTANTS
X macro to list all constants conversion & bindings.
const UnitName unit_from_name(std::string p)
Get the UnitName enum value from a unit name as a string.
double f64
Alias for double.
std::int32_t i32
32 bit integer
UnitPrefix
Enum of all prefixes.
const UnitPrefix unit_prefix_from_name(std::string p)
Get the UnitPrefix enum value from a prefix name as a string.
Pybind11 include and definitions.
#define ON_PYTHON_INIT
Register a Python module init function using static initialization.
#define X
Temp definition for the X macro call to define the log levels.