Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "coniferest"
version = "0.1.2"
edition = "2021"
edition = "2024"

[lib]
name = "calc_trees"
Expand All @@ -22,10 +22,10 @@ default = ["pyo3/abi3-py310"]
[dependencies]
enum_dispatch = "0.3"
itertools = "0.14"
pyo3 = { version = "0.25", features = ["extension-module"] }
pyo3 = { version = "0.27", features = ["extension-module"] }
# Needs to be consistent with ndarray dependency in numpy
ndarray = { version = "0.16", features = ["rayon"] }
ndarray = { version = "0.17", features = ["rayon"] }
num-traits = "0.2"
numpy = "0.25"
numpy = "0.27.1"
# Needs to be consistent with rayon dependency in ndarray
rayon = "1.11"
10 changes: 5 additions & 5 deletions rust/src/selector.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use numpy::{Element, PyArrayDescr};
use pyo3::prelude::{PyAnyMethods, PyDictMethods};
use pyo3::sync::GILOnceCell;
use pyo3::prelude::PyDictMethods;
use pyo3::sync::PyOnceLock;
use pyo3::types::PyDict;
use pyo3::{py_run, Bound, Py, PyResult, Python};
use pyo3::{Bound, Py, PyResult, Python, py_run};

static SELECTOR_DTYPE_CELL: GILOnceCell<Py<PyArrayDescr>> = GILOnceCell::new();
static SELECTOR_DTYPE_CELL: PyOnceLock<Py<PyArrayDescr>> = PyOnceLock::new();

/// Selector is the representation of decision tree nodes: either branches or leafs.
///
Expand Down Expand Up @@ -50,7 +50,7 @@ impl Selector {
.get_item("dtype")
.expect("Error in built-in Python code for dtype initialization")
.expect("Error in built-in Python code for dtype initialization: dtype cannot be None")
.downcast::<PyArrayDescr>()?.clone()
.cast::<PyArrayDescr>()?.clone()
.unbind())
})?;
Ok(unbind_dtype.bind(py).clone())
Expand Down
2 changes: 1 addition & 1 deletion rust/src/tree_traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use num_traits::AsPrimitive;
use numpy::{Element, PyArray1, PyArray2, PyArrayMethods};
use pyo3::exceptions::PyValueError;
use pyo3::prelude::PyAnyMethods;
use pyo3::{pyfunction, Bound, FromPyObject, PyResult, Python};
use pyo3::{Bound, FromPyObject, PyResult, Python, pyfunction};

type DeltaSumHitCount<'py> = (Bound<'py, PyArray2<f64>>, Bound<'py, PyArray2<i64>>);

Expand Down
Loading