Skip to content

Commit 2e4e87b

Browse files
upgraded pyo version (#8)
* upgraded pyo version * Update pr-test.yml
1 parent ad362de commit 2e4e87b

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/pr-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
pip install nbconvert
1717
pip install black_nbconvert
1818
pip install markupsafe==2.0.1
19+
pip install toml
1920
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2021
git config --local user.email "action@github.com"
2122
git config --local user.name "GitHub Action"

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "graph_pca"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition = "2021"
55

66
[dependencies]
7-
pyo3 = { version = "0.21.1", features = ["extension-module"] }
8-
nalgebra = "0.32.3"
7+
pyo3 = { version = "0.29.0", features = ["extension-module"] }
8+
nalgebra = "0.35.0"
99
rayon = "1.8.0"
10-
kdtree = "0.7.0"
11-
petgraph = "0.6.4"
10+
kdtree = "0.8.0"
11+
petgraph = "0.8.3"
1212

1313
[lib]
1414
name = "graph_pca"
@@ -19,4 +19,4 @@ crate-type = ["cdylib"]
1919
codegen-units = 1
2020
lto = "fat"
2121
panic = "abort"
22-
strip = "symbols"
22+
strip = "symbols"

src/graph_pca_lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn get_pca(eigenvalues: &[f64]) -> Vec<f64> {
127127
.collect()
128128
}
129129

130-
#[pyclass]
130+
#[pyclass(from_py_object)]
131131
#[derive(Clone, PartialEq)]
132132
pub enum Feature {
133133
Eigenvalues,
@@ -198,3 +198,4 @@ pub fn calculate_features(
198198

199199
vectors_per_feature
200200
}
201+

src/python_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use pyo3::prelude::*;
33
mod graph_pca_lib;
44

55
#[pymodule]
6-
fn graph_pca(_py: Python<'_>, module: &PyModule) -> PyResult<()> {
6+
fn graph_pca(module: &Bound<'_, PyModule>) -> PyResult<()> {
77
module.add_function(wrap_pyfunction!(calculate_features, module)?)?;
88
module.add_class::<Feature>()?;
99
Ok(())

0 commit comments

Comments
 (0)