Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix np.NaN to np.nan #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fastbarnes/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _interpolate_opt_convol(pts, val, sigma, x0, step, size, num_iter):
# set smaller weights to NaN with overall effect that corresponding quotient is NaN, too
for j in range(size[0]):
for i in range(size[1]):
if wg[j,i] < factor: wg[j,i] = np.NaN
if wg[j,i] < factor: wg[j,i] = np.nan

# yet to be considered:
# - add offset again to resulting quotient
Expand Down Expand Up @@ -325,7 +325,7 @@ def _interpolate_convol(pts, val, sigma, x0, step, size, num_iter):
# set smaller weights to NaN with overall effect that corresponding quotient is NaN, too
for j in range(size[0]):
for i in range(size[1]):
if wg[j,i] < factor: wg[j,i] = np.NaN
if wg[j,i] < factor: wg[j,i] = np.nan

# yet to be considered:
# - add offset again to resulting quotient
Expand Down Expand Up @@ -439,7 +439,7 @@ def _interpolate_radius(pts, val, sigma, x0, step, size, min_weight):
if weight_total >= 0.0022:
grid_value[j,i] = weighted_sum / weight_total + offset
else:
grid_value[j,i] = np.NaN
grid_value[j,i] = np.nan

return grid_value

Expand Down Expand Up @@ -470,6 +470,6 @@ def _interpolate_naive(pts, val, sigma, x0, step, size):
if weight_total > 0.0:
grid_value[j,i] = weighted_sum / weight_total + offset
else:
grid_value[j,i] = np.NaN
grid_value[j,i] = np.nan

return grid_value
2 changes: 1 addition & 1 deletion fastbarnes/interpolationS2.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _interpolate_naive_S2(pts, val, sigma, x0, step, size):
if weight_total > 0.0:
grid_val[j,i] = weighted_sum / weight_total + offset
else:
grid_val[j,i] = np.NaN
grid_val[j,i] = np.nan

return grid_val

Expand Down