Skip to content

Commit

Permalink
minor: removed unneeded returns in fourierradon numba methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed Oct 3, 2024
1 parent 7e2cec1 commit 75e0bd4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions pylops/signalprocessing/_fourierradon2d_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def _radon_inner_2d(X, Y, f, px, h, flim0, flim1, npx, nh):
for ifr in range(flim0, flim1):
for ipx in range(npx):
Y[ih, ifr] += X[ipx, ifr] * exp(-1j * 2 * pi * f[ifr] * px[ipx] * h[ih])
return Y


@jit(nopython=True, parallel=parallel, nogil=True, cache=True, fastmath=True)
Expand All @@ -25,4 +24,3 @@ def _aradon_inner_2d(X, Y, f, px, h, flim0, flim1, npx, nh):
for ifr in range(flim0, flim1):
for ih in range(nh):
X[ipx, ifr] += Y[ih, ifr] * exp(1j * 2 * pi * f[ifr] * px[ipx] * h[ih])
return X
2 changes: 0 additions & 2 deletions pylops/signalprocessing/_fourierradon3d_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def _radon_inner_3d(X, Y, f, py, px, hy, hx, flim0, flim1, npy, npx, nhy, nhx):
* f[ifr]
* (py[ipy] * hy[ihy] + px[ipx] * hx[ihx])
)
return Y


@jit(nopython=True, parallel=parallel, nogil=True, cache=True, fastmath=True)
Expand All @@ -41,4 +40,3 @@ def _aradon_inner_3d(X, Y, f, py, px, hy, hx, flim0, flim1, npy, npx, nhy, nhx):
* f[ifr]
* (py[ipy] * hy[ihy] + px[ipx] * hx[ihx])
)
return X
4 changes: 2 additions & 2 deletions pylops/signalprocessing/fourierradon2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _matvec_numba(self, x: NDArray) -> NDArray:
y = np.zeros((self.nh, self.nfft2), dtype=self.cdtype)

x = sp.fft.rfft(x, n=self.nfft, axis=-1)
y = _radon_inner_2d(
_radon_inner_2d(
x,
y,
self.f,
Expand All @@ -281,7 +281,7 @@ def _rmatvec_numba(self, y: NDArray) -> NDArray:
x = np.zeros((self.npx, self.nfft2), dtype=self.cdtype)

y = sp.fft.rfft(y, n=self.nfft, axis=-1)
x = _aradon_inner_2d(
_aradon_inner_2d(
x,
y,
self.f,
Expand Down
4 changes: 2 additions & 2 deletions pylops/signalprocessing/fourierradon3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def _matvec_numba(self, x: NDArray) -> NDArray:
y = np.zeros((self.nhy, self.nhx, self.nfft2), dtype=self.cdtype)

x = sp.fft.rfft(x, n=self.nfft, axis=-1)
y = _radon_inner_3d(
_radon_inner_3d(
x,
y,
self.f,
Expand All @@ -332,7 +332,7 @@ def _rmatvec_numba(self, y: NDArray) -> NDArray:
x = np.zeros((self.npy, self.npx, self.nfft2), dtype=self.cdtype)

y = sp.fft.rfft(y, n=self.nfft, axis=-1)
x = _aradon_inner_3d(
_aradon_inner_3d(
x,
y,
self.f,
Expand Down

0 comments on commit 75e0bd4

Please sign in to comment.