Skip to content

Commit

Permalink
Merge pull request #126 from spencerahill/compat2024
Browse files Browse the repository at this point in the history
Further numpy 1.24 compatability: np.int_ -> int, np.bool_ -> bool
  • Loading branch information
ajdawson authored Oct 1, 2024
2 parents f0883ab + 6be4155 commit a312ce0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion windspharm/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ def inspect_gridtype(latitudes):


def to3d(array):
new_shape = array.shape[:2] + (np.prod(array.shape[2:], dtype=np.int_),)
new_shape = array.shape[:2] + (np.prod(array.shape[2:], dtype=int),)
return array.reshape(new_shape)
2 changes: 1 addition & 1 deletion windspharm/tests/test_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TestStandardErrorHandlers(ErrorHandlersTest):
def test_masked_values(self):
# masked values in inputs should raise an error
solution = reference_solutions(self.interface, self.gridtype)
mask = np.empty(solution['uwnd'].shape, dtype=np.bool_)
mask = np.empty(solution['uwnd'].shape, dtype=bool)
mask[:] = False
mask[1, 1] = True
u = ma.array(solution['uwnd'], mask=mask, fill_value=1.e20)
Expand Down
2 changes: 1 addition & 1 deletion windspharm/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __order_dims(d, inorder):


def __reshape(d):
out = d.reshape(d.shape[:2] + (np.prod(d.shape[2:], dtype=np.int_),))
out = d.reshape(d.shape[:2] + (np.prod(d.shape[2:], dtype=int),))
return out, d.shape


Expand Down

0 comments on commit a312ce0

Please sign in to comment.