Skip to content

Commit

Permalink
Replace np.NaN with np.nan (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Oct 13, 2023
1 parent a0747f4 commit 4d659d8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion geoviews/data/geopandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def values(cls, dataset, dimension, expanded=True, flat=True, compute=True, keep
ds.data['geometry'] = ds.data.pop(data.geometry.name)
values.append(ds.interface.values(ds, dimension))
if 'Point' not in geom_type and expanded:
values.append([np.NaN])
values.append([np.nan])
values = values if 'Point' in geom_type or not expanded else values[:-1]
if not values:
return np.array([])
Expand Down
2 changes: 1 addition & 1 deletion geoviews/operation/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def _process_element(self, element):
mask[1:, :-1][to_mask[:-1]] = True
mask[:-1, 1:][to_mask[1:]] = True
mask[:-1, :-1][to_mask[1:]] = True
zs[mask] = np.NaN
zs[mask] = np.nan

params = get_param_values(element)
return element.clone((PX, PY, zs), crs=self.p.projection, **params)
Expand Down
2 changes: 1 addition & 1 deletion geoviews/plotting/bokeh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def get_extents(self, element, ranges, range_type='combined', **kwargs):
(x0, x1), (y0, y1) = proj.x_limits, proj.y_limits
return tuple(round(c, 12) for c in (x0, y0, x1, y1))
elif self.overlaid:
return (np.NaN,)*4
return (np.nan,)*4
return super().get_extents(element, ranges, range_type)

def get_data(self, element, ranges, style):
Expand Down
2 changes: 1 addition & 1 deletion geoviews/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def get_extents(self, element, ranges, range_type='combined', **kwargs):
extents = None
else:
extents = project_extents(extents, element.crs, proj)
return (np.NaN,)*4 if not extents else extents
return (np.nan,)*4 if not extents else extents
2 changes: 1 addition & 1 deletion geoviews/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def from_xarray(da, crs=None, apply_transform=False, nan_nodata=False, **kwargs)

values = values.astype(float)
for d in da.attrs['nodatavals']:
values[values==d] = np.NaN
values[values==d] = np.nan
data += (values,)

if 'datatype' not in kwargs:
Expand Down

0 comments on commit 4d659d8

Please sign in to comment.