Skip to content

Commit b02419f

Browse files
authored
Merge pull request #92 from zdaq12/units
adding cm and um to units
2 parents 97e433e + 53a2985 commit b02419f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/pypartmc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ PYBIND11_MODULE(PyPartMC, m) {
189189
si.attr("mol") = py::float_(1.);
190190
si.attr("kg") = py::float_(1.);
191191
si.attr("g") = py::float_(1e-3);
192+
si.attr("cm") = py::float_(.01);
193+
si.attr("um") = py::float_(1e-6);
192194

193195
m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO);
194196
}

tests/test_units.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ class TestUnits:
66
@staticmethod
77
def test_length():
88
assert ppmc.si.m == 1
9+
assert ppmc.si.cm == 0.01
10+
assert ppmc.si.um == 1e-6
911

1012
@staticmethod
1113
def test_temperatur():

0 commit comments

Comments
 (0)