Skip to content

Commit

Permalink
replace NaN with nan for numpy 2.0 prep
Browse files Browse the repository at this point in the history
  • Loading branch information
BradleySappington committed Jan 25, 2024
1 parent 064dc08 commit e2c4e1b
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

Check warning on line 702 in webbpsf/utils.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/utils.py#L702

Added line #L702 was not covered by tests

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

Check warning on line 711 in webbpsf/utils.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/utils.py#L711

Added line #L711 was not covered by tests

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

Check warning on line 720 in webbpsf/utils.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/utils.py#L720

Added line #L720 was not covered by tests

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

Check warning on line 729 in webbpsf/utils.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/utils.py#L729

Added line #L729 was not covered by tests

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

Expand Down

0 comments on commit e2c4e1b

Please sign in to comment.