diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 4bc1b12..437b729 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -16,6 +16,7 @@ jobs: pip install nbconvert pip install black_nbconvert pip install markupsafe==2.0.1 + pip install toml if [ -f requirements.txt ]; then pip install -r requirements.txt; fi git config --local user.email "action@github.com" git config --local user.name "GitHub Action" diff --git a/Cargo.toml b/Cargo.toml index 8d1a4ca..1238af5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "graph_pca" -version = "0.2.0" +version = "0.3.0" edition = "2021" [dependencies] -pyo3 = { version = "0.21.1", features = ["extension-module"] } -nalgebra = "0.32.3" +pyo3 = { version = "0.29.0", features = ["extension-module"] } +nalgebra = "0.35.0" rayon = "1.8.0" -kdtree = "0.7.0" -petgraph = "0.6.4" +kdtree = "0.8.0" +petgraph = "0.8.3" [lib] name = "graph_pca" @@ -19,4 +19,4 @@ crate-type = ["cdylib"] codegen-units = 1 lto = "fat" panic = "abort" -strip = "symbols" \ No newline at end of file +strip = "symbols" diff --git a/src/graph_pca_lib.rs b/src/graph_pca_lib.rs index f3f90fc..7a52146 100644 --- a/src/graph_pca_lib.rs +++ b/src/graph_pca_lib.rs @@ -127,7 +127,7 @@ fn get_pca(eigenvalues: &[f64]) -> Vec { .collect() } -#[pyclass] +#[pyclass(from_py_object)] #[derive(Clone, PartialEq)] pub enum Feature { Eigenvalues, @@ -198,3 +198,4 @@ pub fn calculate_features( vectors_per_feature } + diff --git a/src/python_lib.rs b/src/python_lib.rs index e993875..20600d8 100644 --- a/src/python_lib.rs +++ b/src/python_lib.rs @@ -3,7 +3,7 @@ use pyo3::prelude::*; mod graph_pca_lib; #[pymodule] -fn graph_pca(_py: Python<'_>, module: &PyModule) -> PyResult<()> { +fn graph_pca(module: &Bound<'_, PyModule>) -> PyResult<()> { module.add_function(wrap_pyfunction!(calculate_features, module)?)?; module.add_class::()?; Ok(())