From 08068ef46fa54adffd6caebe0fa776620978c8ef Mon Sep 17 00:00:00 2001 From: Saveliy Yusufov Date: Sun, 4 Feb 2024 02:39:27 -0500 Subject: [PATCH] Adjust pybindings to work with new API --- pybindings/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pybindings/src/lib.rs b/pybindings/src/lib.rs index 8a00215..7886bb3 100644 --- a/pybindings/src/lib.rs +++ b/pybindings/src/lib.rs @@ -1,10 +1,15 @@ use numpy::PyReadwriteArray1; -use phastft::fft_dif; +use phastft::{fft as fft_rs, planner::Planner}; use pyo3::prelude::*; #[pyfunction] fn fft(mut reals: PyReadwriteArray1, mut imags: PyReadwriteArray1) { - fft_dif(reals.as_slice_mut().unwrap(), imags.as_slice_mut().unwrap()); + let mut planner = Planner::new(reals.len()); + fft_rs( + reals.as_slice_mut().unwrap(), + imags.as_slice_mut().unwrap(), + &mut planner, + ); } /// A Python module implemented in Rust.