Skip to content

Commit

Permalink
deprecation of np.bool
Browse files Browse the repository at this point in the history
  • Loading branch information
philippeller committed Oct 1, 2024
1 parent 962c322 commit 123c149
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dama/core/gridarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __getitem__(self, item, *args):
raise IndexError('No variable %s in DataSet' % item)

if isinstance(item, dm.GridArray):
if item.dtype == np.bool:
if item.dtype == bool:
mask = np.logical_and(~self.mask, ~np.asarray(item))
new_item = dm.GridArray(np.asarray(self), grid=self.grid)
new_item.mask = mask
Expand Down Expand Up @@ -235,7 +235,7 @@ def array_shape(self):

def __setitem__(self, item, val):
if isinstance(item, dm.GridArray):
if item.dtype == np.bool:
if item.dtype == bool:
mask = np.logical_and(~self.mask, ~np.asarray(item))
if np.isscalar(val):
self[item].data[mask] = val
Expand Down
2 changes: 1 addition & 1 deletion dama/core/griddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __getitem__(self, item):

# mask
if isinstance(item, dm.GridArray):
if item.dtype == np.bool:
if item.dtype == bool:
# in this case it is a mask
# ToDo: masked operations behave strangely, operations are applyed to all elements, even if masked
new_data = dm.GridData(self._grid)
Expand Down
Empty file modified dama/plotting/stat_plot.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='dama',
version='0.4.6',
version='0.4.8',
packages=find_packages(),
license='Apache 2.0',
author='Philipp Eller',
Expand Down

0 comments on commit 123c149

Please sign in to comment.