Skip to content
Open
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ macro_rules! _create_pyfunc_without_x {
) -> Bound<'py, PyArray1<usize>> {
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))?;
Expand All @@ -44,7 +44,7 @@ macro_rules! _create_pyfunc_without_x_with_ratio {
) -> Bound<'py, PyArray1<usize>> {
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))?;
Expand Down Expand Up @@ -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))?;
Expand All @@ -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))?;
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down