Skip to content

Commit

Permalink
Merge pull request #3606 from dopplershift/bump-numpy2
Browse files Browse the repository at this point in the history
Bump to numpy 2
  • Loading branch information
dcamron committed Aug 22, 2024
2 parents 4f9e536 + de0cf13 commit d00544a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/meteogram_metpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
(<Quantity(1008.0, 'hectopascal')>, <Quantity(29.3, 'degree_Celsius')>,
<Quantity(26.5176931, 'degree_Celsius')>, 0)
<Quantity(26.5176931, 'degree_Celsius')>, np.int64(0))
See Also
--------
Expand Down
4 changes: 3 additions & 1 deletion src/metpy/plots/declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/plots/test_declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit d00544a

Please sign in to comment.