Skip to content

Commit

Permalink
Merge pull request #426 from SepandKashani/master
Browse files Browse the repository at this point in the history
[BugFix] Robustize cuFINUFFT Python guru interface.
  • Loading branch information
ahbarnett authored Apr 23, 2024
2 parents bdfb5f0 + 943b0a7 commit aff74f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/cufinufft/cufinufft/_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"""

import atexit
import collections.abc
import numbers
import sys
import warnings

Expand Down Expand Up @@ -108,8 +110,12 @@ def __init__(self, nufft_type, n_modes, n_trans=1, eps=1e-6, isign=None,
else:
raise TypeError("Expected complex64 or complex128.")

if isinstance(n_modes, int):
if isinstance(n_modes, numbers.Integral):
n_modes = (n_modes,)
elif isinstance(n_modes, collections.abc.Iterable):
n_modes = tuple(n_modes)
else:
raise ValueError(f"Invalid n_modes '{n_modes}'")

self.dim = len(n_modes)
self.type = nufft_type
Expand Down

0 comments on commit aff74f2

Please sign in to comment.