Skip to content

Commit

Permalink
bug: fix chirpradon3d pyfftw import
Browse files Browse the repository at this point in the history
Remove any direct access to pyfftw and instead use
pyfftw_message to check if the library is installed
and correctly imported.
  • Loading branch information
mrava87 committed Oct 4, 2024
1 parent 7c58f0f commit ce4b83d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pylops/signalprocessing/chirpradon3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,23 @@ def __init__(

@reshaped
def _matvec(self, x: NDArray) -> NDArray:
if self.engine == "fftw" and pyfftw is not None:
if self.engine == "fftw" and pyfftw_message is None:
return _chirp_radon_3d_fftw(
x, self.dt, self.dy, self.dx, self.pmax, mode="f", **self.kwargs_fftw
)
return _chirp_radon_3d(x, self.dt, self.dy, self.dx, self.pmax, mode="f")

@reshaped
def _rmatvec(self, x: NDArray) -> NDArray:
if self.engine == "fftw" and pyfftw is not None:
if self.engine == "fftw" and pyfftw_message is None:
return _chirp_radon_3d_fftw(
x, self.dt, self.dy, self.dx, self.pmax, mode="a", **self.kwargs_fftw
)
return _chirp_radon_3d(x, self.dt, self.dy, self.dx, self.pmax, mode="a")

def inverse(self, x: NDArray) -> NDArray:
x = x.reshape(self.dimsd)
if self.engine == "fftw" and pyfftw is not None:
if self.engine == "fftw" and pyfftw_message is None:
y = _chirp_radon_3d_fftw(
x, self.dt, self.dy, self.dx, self.pmax, mode="i", **self.kwargs_fftw
)
Expand Down

0 comments on commit ce4b83d

Please sign in to comment.