Skip to content

Commit

Permalink
Make dim_type an arithmetic enum to preserve out==set
Browse files Browse the repository at this point in the history
- Closes gh-134
- Establish compatibility with nanobind 2, depend on 1.3
  • Loading branch information
inducer committed May 28, 2024
1 parent c9c99b9 commit 3cb615c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ requires = [
"wheel>=0.34.2",
"cmake>=3.18",
"scikit-build",
"nanobind",
"nanobind>=1.3",
"ninja",
"pcpp",
]
Expand Down
4 changes: 3 additions & 1 deletion src/wrapper/wrap_isl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ NB_MODULE(_isl, m)
.ENUM_VALUE(isl_stat_, ok)
;

py::enum_<isl_dim_type>(m, "dim_type")
// Arithmetic (i.e. export numerical values) to ensure that out == set, as on
// the C side.
py::enum_<isl_dim_type>(m, "dim_type", py::is_arithmetic())
.ENUM_VALUE(isl_dim_, cst)
.ENUM_VALUE(isl_dim_, param)
.value("in_", isl_dim_in)
Expand Down

0 comments on commit 3cb615c

Please sign in to comment.