Skip to content

Commit

Permalink
Adjust pybindings to work with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
smu160 committed Feb 4, 2024
1 parent 98d20e7 commit 08068ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pybindings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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<f64>, mut imags: PyReadwriteArray1<f64>) {
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.
Expand Down

0 comments on commit 08068ef

Please sign in to comment.