diff --git a/ci/requirements.txt b/ci/requirements.txt index 8bdc2dc2c94..e4d40f9354b 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -1,5 +1,5 @@ matplotlib==3.9.2 -numpy==1.26.4 +numpy==2.0.1 pandas==2.2.2 pooch==1.8.2 pint==0.24.3 diff --git a/examples/meteogram_metpy.py b/examples/meteogram_metpy.py index e0bff215de3..90bb8784de0 100644 --- a/examples/meteogram_metpy.py +++ b/examples/meteogram_metpy.py @@ -181,7 +181,7 @@ def plot_pressure(self, p, plot_range=None): # Parse dates from .csv file, knowing their format as a string and convert to datetime def parse_date(date): - return dt.datetime.strptime(date.decode('ascii'), '%Y-%m-%d %H:%M:%S') + return dt.datetime.strptime(date, '%Y-%m-%d %H:%M:%S') testdata = np.genfromtxt(get_test_data('timeseries.csv', False), names=True, dtype=None, diff --git a/src/metpy/calc/thermo.py b/src/metpy/calc/thermo.py index 86d88da7bf4..b87a037e056 100644 --- a/src/metpy/calc/thermo.py +++ b/src/metpy/calc/thermo.py @@ -2588,7 +2588,7 @@ def most_unstable_parcel(pressure, temperature, dewpoint, height=None, bottom=No >>> # find most unstable parcel of depth 50 hPa >>> most_unstable_parcel(p, T, Td, depth=50*units.hPa) (, , - , 0) + , np.int64(0)) See Also -------- diff --git a/src/metpy/plots/declarative.py b/src/metpy/plots/declarative.py index 843c82d92b6..614707b90ee 100644 --- a/src/metpy/plots/declarative.py +++ b/src/metpy/plots/declarative.py @@ -1012,7 +1012,9 @@ def _build(self): # If we're on a map, we use min/max for y and manually figure out origin to try to # avoid upside down images created by images where y[0] > y[-1], as well as # specifying the transform - kwargs['extent'] = (x_like[0], x_like[-1], y_like.min(), y_like.max()) + # TODO item() shouldn't be necessary, but is until pydata/xarray#9043 is fixed. + kwargs['extent'] = (x_like[0].item(), x_like[-1].item(), + y_like.min().item(), y_like.max().item()) kwargs['origin'] = 'upper' if y_like[0] > y_like[-1] else 'lower' kwargs.setdefault('cmap', self._cmap_obj) kwargs.setdefault('norm', self._norm_obj) diff --git a/tests/plots/test_declarative.py b/tests/plots/test_declarative.py index 0947b1544a3..121ca2717aa 100644 --- a/tests/plots/test_declarative.py +++ b/tests/plots/test_declarative.py @@ -285,7 +285,7 @@ def test_declarative_figsize(): @pytest.mark.mpl_image_compare(remove_text=True, - tolerance=0.104 if version_check('cartopy<0.23') else 0.031) + tolerance=0.104 if version_check('cartopy<0.23') else 0.033) @needs_cartopy def test_declarative_smooth_field(): """Test the smoothing of the field with smooth_field trait."""