29 py::class_<UnitSystem>(m,
"UnitSystem")
31 py::init([](
f64 unit_time,
38 return std::make_unique<UnitSystem>(
48 py::arg(
"unit_time") = 1,
49 py::arg(
"unit_length") = 1,
50 py::arg(
"unit_mass") = 1,
51 py::arg(
"unit_current") = 1,
52 py::arg(
"unit_temperature") = 1,
53 py::arg(
"unit_qte") = 1,
54 py::arg(
"unit_lumint") = 1)
57 [](UnitSystem &self, std::string name,
i32 power, std::string pref) {
60 return self.runtime_get(pref_, shamunits::units::unit_from_name(name), power);
65 py::arg(
"pref") =
"None")
68 [](UnitSystem &self, std::string name,
i32 power, std::string pref) {
71 return self.runtime_to(pref_, shamunits::units::unit_from_name(name), power);
76 py::arg(
"pref") =
"None"
80 py::class_<shamunits::Constants<f64>>(m,
"Constants")
81 .def(py::init([](UnitSystem s) {
82 return std::make_unique<shamunits::Constants<f64>>(s);
89 [](shamunits::Constants<f64> &cte, i32 power) { \
90 return sycl::pown(cte.st(), power); \