From c01e098a2f39818aa6be5bf9546098fc3f7cd809 Mon Sep 17 00:00:00 2001 From: zmoon Date: Thu, 10 Oct 2024 18:18:25 -0500 Subject: [PATCH] `.dims` -> `.sizes` addressing the xarray warning --- melodies_monet/_cli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/melodies_monet/_cli.py b/melodies_monet/_cli.py index 849ad646..96c213cb 100644 --- a/melodies_monet/_cli.py +++ b/melodies_monet/_cli.py @@ -303,7 +303,7 @@ def get_aeronet( .drop_vars(site_vns) .merge(ds_site) .set_coords(site_vns) - .assign(x=range(ds_site.dims["x"])) + .assign(x=range(ds_site.sizes["x"])) .expand_dims("y") .transpose("time", "y", "x") ) @@ -459,7 +459,7 @@ def get_airnow( .drop_vars(site_vns) .merge(ds_site) .set_coords(["latitude", "longitude"]) - .assign(x=range(ds_site.dims["x"])) + .assign(x=range(ds_site.sizes["x"])) ) # Add units @@ -670,7 +670,7 @@ def get_utc_offset(*, lat, lon): .drop_vars(site_vns) .merge(ds_site) .set_coords(["latitude", "longitude"]) - .assign(x=range(ds_site.dims["x"])) + .assign(x=range(ds_site.sizes["x"])) ) # Add units @@ -889,7 +889,7 @@ def get_utc_offset(*, lat, lon): .drop_vars(site_vns) .merge(ds_site) .set_coords(["latitude", "longitude"]) - .assign(x=range(ds_site.dims["x"])) + .assign(x=range(ds_site.sizes["x"])) ) # Add units @@ -1129,7 +1129,7 @@ def get_aqs( .swap_dims(siteid="x") .merge(ds_site) .set_coords(["latitude", "longitude"]) - .assign(x=range(ds_site.dims["x"])) + .assign(x=range(ds_site.sizes["x"])) ) # Add units