Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "pyNFFT3"
version = "1.0.1"
version = "1.0.2"
authors = [
{ name="Michael Nolander", email="nolander.michael@gmail.com" },
]
Expand Down
28 changes: 14 additions & 14 deletions src/pyNFFT3/FSFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __init__(
self.init_done = False # bool for plan init
self.finalized = False # bool for finalizer
# self.x = None # nodes, will be set later
self.f = None # function coefficients
self.fhat = None # spherical Fourier coefficients
self._f = None # function coefficients
self._fhat = None # spherical Fourier coefficients

if N <= 0:
raise ValueError(f"Invalid N: {N}. Argument must be a positive integer")
Expand Down Expand Up @@ -197,11 +197,11 @@ def fsft_trafo(self):
if self.finalized:
raise RuntimeError("FSFT already finalized")

if not hasattr(self, "fhat"):
if not hasattr(self, "_fhat"):
raise ValueError("fhat has not been set.")
self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfsftlib.jnfsft_trafo(self.plan), shape=(self.M * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def trafo(self):
"""
Expand All @@ -217,11 +217,11 @@ def fsft_trafo_direct(self):
if self.finalized:
raise RuntimeError("FSFT already finalized")

if self.fhat is None:
if self._fhat is None:
raise ValueError("fhat has not been set.")
self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfsftlib.jnfsft_trafo_direct(self.plan), shape=(self.M * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def trafo_direct(self):
"""
Expand All @@ -238,11 +238,11 @@ def fsft_adjoint(self):
if self.finalized:
raise RuntimeError("FSFT already finalized")

if not hasattr(self, "f"):
if not hasattr(self, "_f"):
raise ValueError("f has not been set.")
self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfsftlib.jnfsft_adjoint(self.plan), shape=(N_total * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def adjoint(self):
"""
Expand All @@ -259,11 +259,11 @@ def fsft_adjoint_direct(self):
if self.finalized:
raise RuntimeError("FSFT already finalized")

if not hasattr(self, "f"):
if not hasattr(self, "_f"):
raise ValueError("f has not been set.")
self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfsftlib.jnfsft_adjoint_direct(self.plan), shape=(N_total * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def adjoint_direct(self):
"""
Expand Down
36 changes: 18 additions & 18 deletions src/pyNFFT3/NFCT.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def __init__(
self.f2 = f2 # FFTW flags
self.init_done = False # bool for plan init
self.finalized = False # bool for finalizer
self.x = None # nodes, will be set later
self.f = None # function values
self.fhat = None # Fourier coefficients
self._X = None # nodes, will be set later
self._f = None # function values
self._fhat = None # Fourier coefficients

def __del__(self):
self.finalize_plan()
Expand Down Expand Up @@ -243,12 +243,12 @@ def nfct_trafo(self):
if self.finalized:
raise RuntimeError("NFCT already finalized")

if not hasattr(self, "fhat"):
if not hasattr(self, "_fhat"):
raise ValueError("fhat has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")
self.f = np.ctypeslib.as_array(_nfctlib.jnfct_trafo(self.plan), shape=(self.M,))
self._f = np.ctypeslib.as_array(_nfctlib.jnfct_trafo(self.plan), shape=(self.M,)).copy()

def trafo(self):
"""
Expand All @@ -264,14 +264,14 @@ def nfct_trafo_direct(self):
if self.finalized:
raise RuntimeError("NFCT already finalized")

if self.fhat is None:
if self._fhat is None:
raise ValueError("fhat has not been set.")

if self.x is None:
if self._X is None:
raise ValueError("x has not been set.")
self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfctlib.jnfct_trafo_direct(self.plan), shape=(self.M,)
)
).copy()

def trafo_direct(self):
"""
Expand All @@ -289,14 +289,14 @@ def nfct_transposed(self):
if self.finalized:
raise RuntimeError("NFCT already finalized")

if self.f is None:
if self._f is None:
raise ValueError("f has not been set.")

if self.x is None:
if self._X is None:
raise ValueError("x has not been set.")
self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfctlib.jnfct_adjoint(self.plan), shape=(Ns,)
)
).copy()

def nfct_transposed_direct(self):
"""
Expand All @@ -307,14 +307,14 @@ def nfct_transposed_direct(self):
if self.finalized:
raise RuntimeError("NFCT already finalized")

if self.f is None:
if self._f is None:
raise ValueError("f has not been set.")

if self.x is None:
if self._X is None:
raise ValueError("x has not been set.")
self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfctlib.jnfct_adjoint_direct(self.plan), shape=(Ns,)
)
).copy()

def nfct_adjoint(self):
"""
Expand Down
38 changes: 19 additions & 19 deletions src/pyNFFT3/NFFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def __init__(
self.f2 = f2 # FFTW flags
self.init_done = False # bool for plan init
self.finalized = False # bool for finalizer
self.x = None # nodes, will be set later
self.f = None # function values
self.fhat = None # Fourier coefficients
self._X = None # nodes, will be set later
self._f = None # function values
self._fhat = None # Fourier coefficients

def __del__(self):
self.finalize_plan()
Expand Down Expand Up @@ -252,14 +252,14 @@ def nfft_trafo(self):
if self.finalized:
raise RuntimeError("NFFT already finalized")

if not hasattr(self, "fhat"):
if not hasattr(self, "_fhat"):
raise ValueError("fhat has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")
self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfftlib.jnfft_trafo(self.plan), shape=(self.M * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def trafo(self):
"""
Expand All @@ -275,15 +275,15 @@ def nfft_trafo_direct(self):
if self.finalized:
raise RuntimeError("NFFT already finalized")

if self.fhat is None:
if self._fhat is None:
raise ValueError("fhat has not been set.")

if self.x is None:
if self._X is None:
raise ValueError("x has not been set.")

self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfftlib.jnfft_trafo_direct(self.plan), shape=(self.M * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def trafo_direct(self):
"""
Expand All @@ -300,15 +300,15 @@ def nfft_adjoint(self):
if self.finalized:
raise RuntimeError("NFFT already finalized")

if not hasattr(self, "f"):
if not hasattr(self, "_f"):
raise ValueError("f has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")

self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfftlib.jnfft_adjoint(self.plan), shape=(Ns * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def adjoint(self):
"""
Expand All @@ -325,15 +325,15 @@ def nfft_adjoint_direct(self):
if self.finalized:
raise RuntimeError("NFFT already finalized")

if not hasattr(self, "f"):
if not hasattr(self, "_f"):
raise ValueError("f has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")

self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfftlib.jnfft_adjoint_direct(self.plan), shape=(Ns * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def adjoint_direct(self):
"""
Expand Down
38 changes: 19 additions & 19 deletions src/pyNFFT3/NFSFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def __init__(
self.nfft_cutoff = nfft_cutoff
self.init_done = False # bool for plan init
self.finalized = False # bool for finalizer
self.x = None # nodes, will be set later
self.f = None # function coefficients
self.fhat = None # spherical Fourier coefficients
self._X = None # nodes, will be set later
self._f = None # function coefficients
self._fhat = None # spherical Fourier coefficients

if N <= 0:
raise ValueError(f"Invalid N: {N}. Argument must be a positive integer")
Expand Down Expand Up @@ -222,14 +222,14 @@ def nfsft_trafo(self):
if self.finalized:
raise RuntimeError("NFSFT already finalized")

if not hasattr(self, "fhat"):
if not hasattr(self, "_fhat"):
raise ValueError("fhat has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")
self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfsftlib.jnfsft_trafo(self.plan), shape=(self.M * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def trafo(self):
"""
Expand All @@ -245,14 +245,14 @@ def nfsft_trafo_direct(self):
if self.finalized:
raise RuntimeError("NFSFT already finalized")

if self.fhat is None:
if self._fhat is None:
raise ValueError("fhat has not been set.")

if self.x is None:
if self._X is None:
raise ValueError("x has not been set.")
self.f = np.ctypeslib.as_array(
self._f = np.ctypeslib.as_array(
_nfsftlib.jnfsft_trafo_direct(self.plan), shape=(self.M * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def trafo_direct(self):
"""
Expand All @@ -269,14 +269,14 @@ def nfsft_adjoint(self):
if self.finalized:
raise RuntimeError("NFSFT already finalized")

if not hasattr(self, "f"):
if not hasattr(self, "_f"):
raise ValueError("f has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")
self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfsftlib.jnfsft_adjoint(self.plan), shape=(N_total * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def adjoint(self):
"""
Expand All @@ -293,14 +293,14 @@ def nfsft_adjoint_direct(self):
if self.finalized:
raise RuntimeError("NFSFT already finalized")

if not hasattr(self, "f"):
if not hasattr(self, "_f"):
raise ValueError("f has not been set.")

if not hasattr(self, "x"):
if not hasattr(self, "_X"):
raise ValueError("x has not been set.")
self.fhat = np.ctypeslib.as_array(
self._fhat = np.ctypeslib.as_array(
_nfsftlib.jnfsft_adjoint_direct(self.plan), shape=(N_total * 2,)
).view(np.complex128)
).view(np.complex128).copy()

def adjoint_direct(self):
"""
Expand Down
Loading
Loading