Skip to content

Commit

Permalink
Merge pull request spacetelescope#791 from BradleySappington/numpy_prep
Browse files Browse the repository at this point in the history
replace NaN with nan for numpy 2.0 prep
  • Loading branch information
obi-wan76 authored Feb 3, 2024
2 parents 0c0e7ad + e2c4e1b commit 01fa6a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webbpsf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def _run_benchmark(timer, iterations=1):
time_fftw = timer.timeit(number=iterations) / iterations
print(" {:.2f} s".format(time_fftw))
else:
time_fftw = np.NaN
time_fftw = np.nan

if poppy.accel_math._NUMEXPR_AVAILABLE:
print("Timing performance with Numexpr:")
Expand All @@ -708,7 +708,7 @@ def _run_benchmark(timer, iterations=1):
time_numexpr = timer.timeit(number=iterations) / iterations
print(" {:.2f} s".format(time_numexpr))
else:
time_numexpr = np.NaN
time_numexpr = np.nan

if poppy.accel_math._CUDA_AVAILABLE:
print("Timing performance with CUDA + Numexpr:")
Expand All @@ -717,7 +717,7 @@ def _run_benchmark(timer, iterations=1):
time_cuda = timer.timeit(number=iterations) / iterations
print(" {:.2f} s".format(time_cuda))
else:
time_cuda = np.NaN
time_cuda = np.nan

if poppy.accel_math._OPENCL_AVAILABLE:
print("Timing performance with OpenCL + Numexpr:")
Expand All @@ -726,7 +726,7 @@ def _run_benchmark(timer, iterations=1):
time_opencl = timer.timeit(number=iterations) / iterations
print(" {:.2f} s".format(time_opencl))
else:
time_opencl = np.NaN
time_opencl = np.nan

poppy.conf.use_fftw, poppy.conf.use_numexpr, poppy.conf.use_cuda, poppy.conf.use_opencl = defaults

Expand Down

0 comments on commit 01fa6a7

Please sign in to comment.