Skip to content

Refactor Python interface

Bram Veenboer requested to merge update-python-interface into master

The Python interface needed a clean-up. The decorator interface is the same, the explicit API is simpler, e.g.:

pm = pmt.create("nvidia", 0)
start = pm.read()
time.sleep(1)
end = pm.read()
joules = pmt.joules(start, end)

Internally, pypmt is still used, but the user only sees pmt. Moreover, there is no longer a need to call the wrapped PMT class, since the high-level wrapper wraps the pybind11 class bindings.

The CMake has also been simplified considerably, the Python bindings are now installed in a properly suffix'ed directory (with Python version).

Merge request reports