From fa15fac24c84493cff1ad6676d10224d6a19d557 Mon Sep 17 00:00:00 2001 From: muchojp <61620767+muchojp@users.noreply.github.com> Date: Fri, 9 Oct 2020 09:20:36 +0900 Subject: [PATCH 1/4] Update constants.py Replace from numpy.asscalar to item() because numpy.asscalar causes FutureWarning. Deprecated since numpy version 1.16: Deprecated, use numpy.ndarray.item() instead. --- src/wrf/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrf/constants.py b/src/wrf/constants.py index 47821ef..1128855 100755 --- a/src/wrf/constants.py +++ b/src/wrf/constants.py @@ -16,7 +16,7 @@ class Constants(object): for key, val in viewitems(wrf_constants.__dict__): - setattr(Constants, key.upper(), np.asscalar(val)) + setattr(Constants, key.upper(), val.item()) OMP_SCHED_STATIC = omp_constants.fomp_sched_static OMP_SCHED_DYNAMIC = omp_constants.fomp_sched_dynamic From 9402254bb42da4dd89064328e5ce160d7262408e Mon Sep 17 00:00:00 2001 From: muchojp <61620767+muchojp@users.noreply.github.com> Date: Fri, 9 Oct 2020 09:26:00 +0900 Subject: [PATCH 2/4] Update decorators.py Because of the change in the structure of the "collections" module, I change a bit. --- src/wrf/decorators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wrf/decorators.py b/src/wrf/decorators.py index 806fbf5..2ff4dec 100644 --- a/src/wrf/decorators.py +++ b/src/wrf/decorators.py @@ -1,6 +1,7 @@ from __future__ import (absolute_import, division, print_function) -from collections import Iterable, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable import wrapt import numpy as np From c1aa5facaf6973cfa544b425cd21982500a68dfa Mon Sep 17 00:00:00 2001 From: muchojp <61620767+muchojp@users.noreply.github.com> Date: Fri, 9 Oct 2020 09:28:37 +0900 Subject: [PATCH 3/4] Update latlonutils.py To avoid FutureWarning, Function "Iterable" should import from collections.abc. --- src/wrf/latlonutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wrf/latlonutils.py b/src/wrf/latlonutils.py index 22191af..0a66030 100644 --- a/src/wrf/latlonutils.py +++ b/src/wrf/latlonutils.py @@ -1,6 +1,6 @@ from __future__ import (absolute_import, division, print_function) -from collections import Iterable +from collections.abc import Iterable import numpy as np From c263d7cbc71389906e4ea9b9afc6e2db85080d46 Mon Sep 17 00:00:00 2001 From: muchojp <61620767+muchojp@users.noreply.github.com> Date: Fri, 9 Oct 2020 09:31:32 +0900 Subject: [PATCH 4/4] Update util.py To avoid FutureWarning, function "Iterable" and "Mapping" should be imported from collections.abc. --- src/wrf/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wrf/util.py b/src/wrf/util.py index d8f6567..40229c7 100644 --- a/src/wrf/util.py +++ b/src/wrf/util.py @@ -3,7 +3,8 @@ from __future__ import (absolute_import, division, print_function) import os from sys import version_info from copy import copy -from collections import Iterable, Mapping, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable, Mapping from itertools import product, tee from types import GeneratorType import datetime as dt