File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,14 @@ void init_CoordSys(py::module& m)
1414
1515 py::class_<CoordSys> coord_sys (m, " CoordSys" );
1616
17- py::enum_ <CoordSys::CoordType>(coord_sys, " CoordType" )
17+ py::native_enum <CoordSys::CoordType>(coord_sys, " CoordType" , " enum.Enum " )
1818 .value (" undef" , CoordSys::CoordType::undef)
1919 .value (" cartesian" , CoordSys::CoordType::cartesian)
2020 .value (" RZ" , CoordSys::CoordType::RZ)
2121 .value (" SPHERICAL" , CoordSys::CoordType::SPHERICAL)
22- .export_values ();
22+ .export_values ()
23+ .finalize ()
24+ ;
2325
2426 coord_sys.def (" __repr__" ,
2527 [](const CoordSys&) {
Original file line number Diff line number Diff line change @@ -29,10 +29,12 @@ void init_IndexType(py::module &m) {
2929
3030 py::class_< IndexType > index_type (m, " IndexType" );
3131
32- py::enum_ <IndexType::CellIndex>(index_type, " CellIndex" )
32+ py::native_enum <IndexType::CellIndex>(index_type, " CellIndex" , " enum.Enum " )
3333 .value (" CELL" , IndexType::CellIndex::CELL)
3434 .value (" NODE" , IndexType::CellIndex::NODE)
35- .export_values ();
35+ .export_values ()
36+ .finalize ()
37+ ;
3638
3739 index_type.def (" __repr__" ,
3840 [](py::object& obj) {
Original file line number Diff line number Diff line change 1111#include < pybind11/pybind11.h>
1212#include < pybind11/functional.h>
1313#include < pybind11/iostream.h>
14+ #include < pybind11/native_enum.h>
1415#include < pybind11/numpy.h>
1516#include < pybind11/operators.h>
1617#include < pybind11/stl.h>
You can’t perform that action at this time.
0 commit comments