Skip to content

Commit

Permalink
fixup: Fixed errors from pyo3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidmt committed May 1, 2024
1 parent a0147c3 commit 8cee7a4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions pylace/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@ strict = true

[tool.black]
line-length = 80


[tool.maturin]
module-name = "lace.core"
10 changes: 5 additions & 5 deletions pylace/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Dependencies

# Tooling
hypothesis==6.65.2
maturin==0.14.10
pytest==7.2.0
pytest-cov==4.0.0
pytest-xdist==3.1.0
hypothesis==6.100.2
maturin==1.5.1
pytest==8.2.0
pytest-cov==5.0.0
pytest-xdist==3.6.1
1 change: 1 addition & 0 deletions pylace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ create_exception!(lace, EngineUpdateError, pyo3::exceptions::PyException);

/// A Python module implemented in Rust.
#[pymodule]
#[pyo3(name = "core")]
fn core(py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<Codebook>()?;
m.add_class::<CoreEngine>()?;
Expand Down
2 changes: 1 addition & 1 deletion pylace/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ fn pyany_to_category(val: &PyAny) -> PyResult<lace::Category> {
let x = val.downcast::<PyString>()?.extract::<String>()?;
Ok(Category::String(x))
}
"int64" | "int32" | "int16" | "int8" => {
"numpy.int64" | "numpy.int32" | "numpy.int16" | "numpy.int8" => {
let x = val.call_method("__int__", (), None)?.extract::<u8>()?;
Ok(Category::U8(x))
}
Expand Down

0 comments on commit 8cee7a4

Please sign in to comment.