python: added class UnitSystem.

This commit is contained in:
Steinar Foss
2019-10-11 16:29:09 +02:00
parent 32ac0034a7
commit c0bd19c59e
7 changed files with 27 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <pybind11/pybind11.h>
#include "converters.hpp"
@@ -48,6 +49,15 @@ void python::common::export_Deck(py::module &module) {
.def( "__getitem__", &getKeyword_string, ref_internal)
.def( "__getitem__", &getKeyword_tuple, ref_internal)
.def( "__str__", &str<Deck>)
.def("active_unit_system", [](const Deck& deck) -> const UnitSystem& {
return deck.getActiveUnitSystem();
} )
.def("default_unit_system", [](const Deck& deck) -> const UnitSystem& {
return deck.getDefaultUnitSystem();
} )
.def( "count", &count )
;
}