Skip to content

Commit a219727

Browse files
authored
Update constants.py
1 parent acd95e1 commit a219727

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/wrf/constants.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
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-
1310
#: Indicates that all times should be used in a diagnostic routine.
1411
ALL_TIMES = None
1512

@@ -66,8 +63,10 @@ class ProjectionTypes(object):
6663
np.dtype(np.float64): Constants.DEFAULT_FILL_DOUBLE
6764
}
6865

69-
if np_version < Version('2.0'):
70-
_DEFAULT_FILL_MAP[np.float_] = Constants.Constants.DEFAULT_FILL_DOUBLE
66+
try:
67+
_DEFAULT_FILL_MAP[np.dtype(np.float_)] = Constants.DEFAULT_FILL_DOUBLE
68+
except AttributeError:
69+
pass
7170

7271
if version_info >= (3, ):
7372
_DEFAULT_FILL_MAP[np.int_] = Constants.DEFAULT_FILL_INT64

0 commit comments

Comments
 (0)