Skip to content

Commit 0ff309d

Browse files
authored
Merge pull request #261 from kprussing/develop
NumPy 2.0+ support
2 parents fa0d595 + a219727 commit 0ff309d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

build_envs/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencies:
1111
- matplotlib
1212
- netcdf4
1313
- numpy
14+
- packaging
1415
- pycodestyle
1516
- setuptools
1617
- sphinx

src/wrf/constants.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ class ProjectionTypes(object):
5959
np.dtype(np.uint32): 4294967295,
6060
np.dtype(np.int64): Constants.DEFAULT_FILL_INT64,
6161
np.dtype(np.uint64): 18446744073709551614,
62-
np.dtype(np.float_): Constants.DEFAULT_FILL_DOUBLE,
6362
np.dtype(np.float32): Constants.DEFAULT_FILL_FLOAT,
6463
np.dtype(np.float64): Constants.DEFAULT_FILL_DOUBLE
6564
}
6665

66+
try:
67+
_DEFAULT_FILL_MAP[np.dtype(np.float_)] = Constants.DEFAULT_FILL_DOUBLE
68+
except AttributeError:
69+
pass
70+
6771
if version_info >= (3, ):
6872
_DEFAULT_FILL_MAP[np.int_] = Constants.DEFAULT_FILL_INT64
6973
else:

test/ci_tests/utests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test(self):
107107
# print (hts_850)
108108
hts_850 = interplevel(hts, p, 850)
109109

110-
nt.assert_allclose(to_np(hts_850), ref_ht_850)
110+
nt.assert_allclose(to_np(hts_850), ref_ht_850, rtol=1e-06)
111111

112112
elif (varname == "vertcross"):
113113
ref_ht_cross = _get_refvals(referent, "vertcross", repeat, multi)

0 commit comments

Comments
 (0)