Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.25k stars 414 forks source link

Nightly build is failing #3649

Closed github-actions[bot] closed 47 minutes ago

github-actions[bot] commented 1 week ago

The Nightly workflow is failing. The tests failed. Log:

============================= test session starts ==============================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
Matplotlib: 3.9.2
Freetype: 2.6.1
Dep Versions: Cartopy: 0.23.0, Dask: 2024.9.1, Matplotlib: 3.9.2, Numpy: 2.1.2,
    Pandas: 2.2.3, Pint: 0.24.3.dev5+g2839f6e, Pooch: v1.8.2, Pyproj: 3.7.0,
    Scipy: 1.14.1, Shapely: 2.0.6, Traitlets: 5.14.3, Xarray: 2024.9.1.dev49+gf45cfe6c
rootdir: /home/runner/work/MetPy/MetPy
configfile: pyproject.toml
plugins: mpl-0.17.0
collected 1536 items

tests/calc/test_basic.py ............................................... [  3%]
........................................................................ [  7%]
.......................                                                  [  9%]
tests/calc/test_calc_tools.py .......................................... [ 11%]
........................................................................ [ 16%]
...................................F.......                              [ 19%]
tests/calc/test_cross_sections.py .............                          [ 20%]
tests/calc/test_indices.py ............................                  [ 22%]
tests/calc/test_kinematics.py .......................................... [ 24%]
......................................                                   [ 27%]
tests/calc/test_thermo.py .............................................. [ 30%]
........................................................................ [ 35%]
........................................................................ [ 39%]
...........................                                              [ 41%]
tests/calc/test_turbulence.py ...........................                [ 43%]
tests/interpolate/test_geometry.py .............                         [ 44%]
tests/interpolate/test_grid.py ......................................    [ 46%]
tests/interpolate/test_interpolate_tools.py .......                      [ 47%]
tests/interpolate/test_one_dimension.py ...................              [ 48%]
tests/interpolate/test_points.py ........................                [ 49%]
tests/interpolate/test_slices.py ........                                [ 50%]
tests/io/test_gempak.py .................................                [ 52%]
tests/io/test_gini.py ..................                                 [ 53%]
tests/io/test_metar.py ........................................          [ 56%]
tests/io/test_nexrad.py ................................................ [ 59%]
........................................................................ [ 64%]
.......................................................                  [ 67%]
tests/io/test_station_data.py ......                                     [ 68%]
tests/io/test_text.py ....                                               [ 68%]
tests/io/test_tools.py ..                                                [ 68%]
tests/plots/test_cartopy_utils.py .......                                [ 68%]
tests/plots/test_ctables.py ..........                                   [ 69%]
tests/plots/test_declarative.py ........................................ [ 72%]
..........................................                               [ 74%]
tests/plots/test_mapping.py ...........xx...........                     [ 76%]
tests/plots/test_mpl.py .                                                [ 76%]
tests/plots/test_patheffects.py ........                                 [ 77%]
tests/plots/test_plot_areas.py .....                                     [ 77%]
tests/plots/test_skewt.py ....................................           [ 79%]
tests/plots/test_station_plot.py ..........................              [ 81%]
tests/plots/test_util.py ..............                                  [ 82%]
tests/plots/test_wx_symbols.py ....                                      [ 82%]
tests/test_cbook.py ..                                                   [ 82%]
tests/test_deprecation.py .                                              [ 82%]
tests/test_packaging.py .                                                [ 82%]
tests/test_testing.py ........                                           [ 83%]
tests/test_xarray.py ................................................... [ 86%]
........................................................................ [ 91%]
........................................................................ [ 96%]
.....................                                                    [ 97%]
tests/units/test_units.py .....................................x..       [100%]

=================================== FAILURES ===================================
___________________ test_parse_grid_arguments_from_dataarray ___________________

    def test_parse_grid_arguments_from_dataarray():
        """Test the parse grid arguments decorator for adding in arguments from xarray."""
        @parse_grid_arguments
        def return_the_kwargs(
            da,
            dz=None,
            dy=None,
            dx=None,
            vertical_dim=None,
            y_dim=None,
            x_dim=None,
            latitude=None,
            parallel_scale=None,
            meridional_scale=None
        ):
            return {
                'dz': dz,
                'dy': dy,
                'dx': dx,
                'vertical_dim': vertical_dim,
                'y_dim': y_dim,
                'x_dim': x_dim,
                'latitude': latitude
            }

        data = xr.DataArray(
            np.zeros((1, 2, 2, 2)),
            dims=('time', 'isobaric', 'lat', 'lon'),
            coords={
                'time': ['2020-01-01T00:00Z'],
                'isobaric': (('isobaric',), [850., 700.], {'units': 'hPa'}),
                'lat': (('lat',), [30., 40.], {'units': 'degrees_north'}),
                'lon': (('lon',), [-100., -90.], {'units': 'degrees_east'})
            }
        ).to_dataset(name='zeros').metpy.parse_cf('zeros')
>       result = return_the_kwargs(data)

tests/calc/test_calc_tools.py:1500: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/metpy/calc/tools.py:1095: in wrapper
    grid_deltas = grid_prototype.metpy.grid_deltas
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/metpy/xarray.py:533: in grid_deltas
    dx, dy = nominal_lat_lon_grid_deltas(
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/metpy/xarray.py:1327: in wrapper
    result = func(*bound_args.args, **bound_args.kwargs)
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/metpy/calc/tools.py:884: in nominal_lat_lon_grid_deltas
    forward_az, _, dy = geod.inv(lon_meridian_diff, lat[:-1], lon_meridian_diff, lat[1:],
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/pyproj/geod.py:398: in inv
    return self._inv_point(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

pyproj/_geod.pyx:329: DeprecationWarning
=========================== short test summary info ============================
FAILED tests/calc/test_calc_tools.py::test_parse_grid_arguments_from_dataarray - DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
============ 1 failed, 1532 passed, 3 xfailed in 519.48s (0:08:39) =============
dopplershift commented 1 week ago

Looks like pyproj, so we'll solve in #3647.

dopplershift commented 47 minutes ago

"Nightly" builds are passing again.