From 2a17d915ce9d548fefb2cbc3a3ad0fab1fc47c71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:23:35 +0000 Subject: [PATCH 1/3] CI: (deps): Bump xarray from 2024.1.1 to 2024.2.0 in /ci Bumps [xarray](https://github.com/pydata/xarray) from 2024.1.1 to 2024.2.0. - [Release notes](https://github.com/pydata/xarray/releases) - [Changelog](https://github.com/pydata/xarray/blob/main/HOW_TO_RELEASE.md) - [Commits](https://github.com/pydata/xarray/compare/v2024.01.1...v2024.02.0) --- updated-dependencies: - dependency-name: xarray dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- ci/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements.txt b/ci/requirements.txt index ed538dfcfe1..da4b723bc3d 100644 --- a/ci/requirements.txt +++ b/ci/requirements.txt @@ -6,4 +6,4 @@ pint==0.23 pyproj==3.6.1 scipy==1.12.0 traitlets==5.14.1 -xarray==2024.1.1 +xarray==2024.2.0 From 50cdc2851bab5a9175779f2e56871dd6426f07f9 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 21 Feb 2024 14:15:40 -0700 Subject: [PATCH 2/3] MNT: Update example xarray output As of xarray 2024.2.0 the repr includes a size estimate. --- src/metpy/xarray.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metpy/xarray.py b/src/metpy/xarray.py index 4030a031ade..2ccb36ce0ab 100644 --- a/src/metpy/xarray.py +++ b/src/metpy/xarray.py @@ -115,10 +115,10 @@ class MetPyDataArrayAccessor: >>> temperature = xr.DataArray([[0, 1], [2, 3]] * units.degC, dims=('lat', 'lon'), ... coords={'lat': [40, 41], 'lon': [-105, -104]}) >>> temperature.metpy.x - + Size: 16B array([-105, -104]) Coordinates: - * lon (lon) int64 -105 -104 + * lon (lon) int64 16B -105 -104 Attributes: _metpy_axis: x,longitude From 25b1d3b7efe7a9c84d36a2d3d0ed91573453f078 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 21 Feb 2024 14:26:32 -0700 Subject: [PATCH 3/3] MNT: Avoid pulling in FrozenDict from xarray This isn't considered part of the public API, and things seem to work fine with a regular dictionary now. --- src/metpy/io/gini.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/metpy/io/gini.py b/src/metpy/io/gini.py index 8a09cb6edcf..f870ceb9e6f 100644 --- a/src/metpy/io/gini.py +++ b/src/metpy/io/gini.py @@ -18,7 +18,6 @@ from xarray.backends.common import AbstractDataStore from xarray.coding.times import CFDatetimeCoder from xarray.coding.variables import CFMaskCoder -from xarray.core.utils import FrozenDict from ._tools import Bits, IOBuffer, NamedStruct, open_as_needed, zlib_decompress_all_frames from ..package_tools import Exporter @@ -368,7 +367,7 @@ def get_variables(self): variables.extend(self._make_coord_vars()) variables.extend(self._make_data_vars()) - return FrozenDict(variables) + return dict(variables) def get_attrs(self): """Get the global attributes. @@ -376,8 +375,8 @@ def get_attrs(self): This is used by `xarray.open_dataset`. """ - return FrozenDict(satellite=self.prod_desc.creating_entity, - sector=self.prod_desc.sector_id) + return {'satellite': self.prod_desc.creating_entity, + 'sector': self.prod_desc.sector_id} class GiniXarrayBackend(BackendEntrypoint):