Skip to content

Commit

Permalink
Merge pull request #92 from zdaq12/units
Browse files Browse the repository at this point in the history
adding cm and um to units
  • Loading branch information
slayoo authored Jun 17, 2022
2 parents 97e433e + 53a2985 commit b02419f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pypartmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ PYBIND11_MODULE(PyPartMC, m) {
si.attr("mol") = py::float_(1.);
si.attr("kg") = py::float_(1.);
si.attr("g") = py::float_(1e-3);
si.attr("cm") = py::float_(.01);
si.attr("um") = py::float_(1e-6);

m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO);
}
2 changes: 2 additions & 0 deletions tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class TestUnits:
@staticmethod
def test_length():
assert ppmc.si.m == 1
assert ppmc.si.cm == 0.01
assert ppmc.si.um == 1e-6

@staticmethod
def test_temperatur():
Expand Down

0 comments on commit b02419f

Please sign in to comment.