Skip to content

Commit 38b605f

Browse files
authored
Merge pull request #7 from NFFT/develop
fixed index_set helper function
2 parents ac88125 + 0dc4918 commit 38b605f

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "pyGroupedTransforms"
7-
version = "1.0.0"
7+
version = "1.1.0"
88
authors = [
99
{ name="Felix Wirth", email="fwi012001@gmail.com" },
1010
]

src/pyGroupedTransforms/NFCTtools.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ def nfct_index_set(
7777
if d == 1:
7878
return np.array([i for i in range(0, bandwidths[0])], "int")
7979

80-
bandwidths = bandwidths[::-1]
81-
tmp = tuple([list(range(0, bw)) for bw in bandwidths])
80+
tmp = tuple([list(range(0, bw)) for bw in bandwidths[::-1]])
8281
tmp = itertools.product(*(tmp[::-1]))
8382

8483
freq = np.empty((d, np.prod(bandwidths)), dtype=int)
@@ -127,7 +126,7 @@ def get_transform(
127126
if bandwidths.ndim > 1 or bandwidths.dtype != "int32":
128127
return "Please use an zero or one-dimensional numpy.array with dtype 'int32' as input"
129128

130-
(M, d) = X.shape
129+
M, d = X.shape
131130

132131
if len(bandwidths) == 0:
133132
return DeferredLinearOperator(

src/pyGroupedTransforms/NFFTtools.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def nfft_index_set(
8888
list(range(int(-bandwidths[0] / 2), int(bandwidths[0] / 2))), dtype="int"
8989
)
9090

91-
tmp = [list(range(int(-bw / 2), int(bw / 2))) for bw in bandwidths]
91+
tmp = [list(range(int(-bw / 2), int(bw / 2))) for bw in bandwidths[::-1]]
9292
tmp = itertools.product(*(tmp[::-1]))
9393

9494
freq = np.empty((d, np.prod(bandwidths)), dtype=int)
@@ -134,11 +134,10 @@ def get_transform(
134134
# Output:
135135
* `F::LinearMap{ComplexF64}` ... Linear map of the Fourier-transform implemented by the NFFT
136136
"""
137-
138137
if bandwidths.ndim > 1 or bandwidths.dtype != "int32":
139138
return "Please use an zero or one-dimensional numpy.array with dtype 'int32' as input"
140139

141-
(M, d) = np.shape(X)
140+
M, d = np.shape(X)
142141

143142
if len(bandwidths) == 0:
144143
return DeferredLinearOperator(

0 commit comments

Comments
 (0)