From 19a24c61aa29adf5191d3216dcc399d4f85962ad Mon Sep 17 00:00:00 2001 From: ahbarnett Date: Tue, 25 Feb 2025 11:47:17 -0500 Subject: [PATCH] fix single-prec py examples to use dtype=complex64 --- python/finufft/examples/guru1d1f.py | 12 ++++++------ python/finufft/examples/guru2d1f.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/finufft/examples/guru1d1f.py b/python/finufft/examples/guru1d1f.py index 6d699cb58..cf51c6b30 100644 --- a/python/finufft/examples/guru1d1f.py +++ b/python/finufft/examples/guru1d1f.py @@ -19,20 +19,20 @@ strt = time.time() -#plan -plan = fp.Plan(1,(N,),dtype='single') +# plan, using proper specifier for single-precision transform +plan = fp.Plan(1,(N,),dtype='complex64') -#set pts +# set pts plan.setpts(x) -#exec +# exec plan.execute(c,F) -#timing +# timing print("Finished nufft in {0:.2g} seconds. Checking..." .format(time.time()-strt)) -#check error +# check error n = 143 # mode to check Ftest = 0.0 # this is so slow... diff --git a/python/finufft/examples/guru2d1f.py b/python/finufft/examples/guru2d1f.py index bd0d693d7..2c5a55f2a 100644 --- a/python/finufft/examples/guru2d1f.py +++ b/python/finufft/examples/guru2d1f.py @@ -34,7 +34,7 @@ # instantiate the plan (note n_trans must be set here), also setting tolerance: t0 = time.time() -plan = finufft.Plan(nufft_type, (N1, N2), eps=1e-4, n_trans=K, dtype='float32') +plan = finufft.Plan(nufft_type, (N1, N2), eps=1e-4, n_trans=K, dtype='complex64') # set the nonuniform points plan.setpts(x, y)