From 040aa1fe17ef3b3a6fa53106bab323618865e18d Mon Sep 17 00:00:00 2001 From: Dimitris Iliopoulos Date: Thu, 5 Jun 2025 14:29:15 -0700 Subject: [PATCH] Upgrade pyo3 to 0.24 --- Cargo.toml | 4 ++-- src/lib.rs | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0b2335..27ddedb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ license = "MIT" [dependencies] downsample_rs = { path = "downsample_rs", features = ["half"]} -pyo3 = { version = "0.22", features = ["extension-module"] } -numpy = { version = "0.22", features = ["half"] } +pyo3 = { version = "0.24", features = ["extension-module"] } +numpy = { version = "0.24", features = ["half"] } half = { version = "2.3.1", default-features = false } paste = { version = "1.0.14", default-features = false } diff --git a/src/lib.rs b/src/lib.rs index 9cd30c2..f5a3786 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ macro_rules! _create_pyfunc_without_x { ) -> Bound<'py, PyArray1> { let y = y.as_slice().unwrap(); let sampled_indices = $resample_mod::$resample_fn(y, n_out); - sampled_indices.into_pyarray_bound(py) + sampled_indices.into_pyarray(py) } // Add the function to the module $mod.add_wrapped(wrap_pyfunction!($name))?; @@ -44,7 +44,7 @@ macro_rules! _create_pyfunc_without_x_with_ratio { ) -> Bound<'py, PyArray1> { let y = y.as_slice().unwrap(); let sampled_indices = $resample_mod::$resample_fn(y, n_out, ratio); - sampled_indices.into_pyarray_bound(py) + sampled_indices.into_pyarray(py) } // Add the function to the module $mod.add_wrapped(wrap_pyfunction!($name))?; @@ -84,7 +84,7 @@ macro_rules! _create_pyfunc_with_x { let x = x.as_slice().unwrap(); let y = y.as_slice().unwrap(); let sampled_indices = $resample_mod::$resample_fn(x, y, n_out); - sampled_indices.into_pyarray_bound(py) + sampled_indices.into_pyarray(py) } // Add the function to the module $mod.add_wrapped(wrap_pyfunction!($name))?; @@ -105,7 +105,7 @@ macro_rules! _create_pyfunc_with_x_with_ratio { let x = x.as_slice().unwrap(); let y = y.as_slice().unwrap(); let sampled_indices = $resample_mod::$resample_fn(x, y, n_out, ratio); - sampled_indices.into_pyarray_bound(py) + sampled_indices.into_pyarray(py) } // Add the function to the module $mod.add_wrapped(wrap_pyfunction!($name))?; @@ -258,7 +258,7 @@ use downsample_rs::minmax as minmax_mod; fn minmax(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- SEQUENTIAL - let sequential_mod = PyModule::new_bound(_py, "sequential")?; + let sequential_mod = PyModule::new(_py, "sequential")?; // ----- WITHOUT X { @@ -274,7 +274,7 @@ fn minmax(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- PARALLEL - let parallel_mod = PyModule::new_bound(_py, "parallel")?; + let parallel_mod = PyModule::new(_py, "parallel")?; // ----- WITHOUT X { @@ -304,7 +304,7 @@ use downsample_rs::m4 as m4_mod; fn m4(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- SEQUENTIAL - let sequential_mod = PyModule::new_bound(_py, "sequential")?; + let sequential_mod = PyModule::new(_py, "sequential")?; // ----- WITHOUT X { @@ -320,7 +320,7 @@ fn m4(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- PARALLEL - let parallel_mod = PyModule::new_bound(_py, "parallel")?; + let parallel_mod = PyModule::new(_py, "parallel")?; // ----- WITHOUT X { @@ -350,7 +350,7 @@ use downsample_rs::lttb as lttb_mod; fn lttb(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- SEQUENTIAL - let sequential_mod = PyModule::new_bound(_py, "sequential")?; + let sequential_mod = PyModule::new(_py, "sequential")?; // Create the Python functions for the module // ----- WITHOUT X @@ -378,7 +378,7 @@ use downsample_rs::minmaxlttb as minmaxlttb_mod; fn minmaxlttb(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- SEQUENTIAL - let sequential_mod = PyModule::new_bound(_py, "sequential")?; + let sequential_mod = PyModule::new(_py, "sequential")?; // ----- WITHOUT X { @@ -394,7 +394,7 @@ fn minmaxlttb(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> { // ----------------- PARALLEL - let parallel_mod = PyModule::new_bound(_py, "parallel")?; + let parallel_mod = PyModule::new(_py, "parallel")?; // ----- WITHOUT X {