Skip to content

Commit f87adf8

Browse files
authored
add NumPy version conditional for default fill mapping
1 parent 7f6dc99 commit f87adf8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/wrf/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
from .py3compat import viewitems
88
from ._wrffortran import wrf_constants, omp_constants
99

10+
from packaging.version import Version
11+
np_version = Version(np.__version__)
12+
1013
#: Indicates that all times should be used in a diagnostic routine.
1114
ALL_TIMES = None
1215

@@ -63,6 +66,9 @@ class ProjectionTypes(object):
6366
np.dtype(np.float64): Constants.DEFAULT_FILL_DOUBLE
6467
}
6568

69+
if np_version < Version('2.0'):
70+
_DEFAULT_FILL_MAP[np.float_] = Constants.Constants.DEFAULT_FILL_DOUBLE
71+
6672
if version_info >= (3, ):
6773
_DEFAULT_FILL_MAP[np.int_] = Constants.DEFAULT_FILL_INT64
6874
else:

0 commit comments

Comments
 (0)