From 72f1892d332aaf7f287034c04037cf902b1dfbe0 Mon Sep 17 00:00:00 2001 From: Anne Barber Date: Wed, 24 Jul 2024 15:49:35 +0100 Subject: [PATCH] Updating the description since introducing the fix for version 1.0.5 i.e. preserving the time dimension when datasets are split --- README.md | 2 ++ cfizer/cfize_ds.py | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f9114e..0d4805c 100644 --- a/README.md +++ b/README.md @@ -122,3 +122,5 @@ The new vocabulary YAML file will be created in the CFizer source code directory 1.0.3 Includes the following fixes: 1) Adds checking for empty DsGroup filepath collections; 2) Adds check for availability of reference variables for converting perturbation values; 3) Corrects Boolean values in vocabulary in Excel spreadsheet to vocabulary tool; 4) Makes some minor corrections and adds some debugging clarifications. README.md updated to include instructions for installation on HPC systems other than JASMIN. Added maintainer to pyproject.toml. 1.0.4 Although CFizer generates CF-1.10 compliant MONC output, `CF_VERSION` in startup.py has been relabelled as 1.8 instead of 1.10 (this label becomes part of the CFizer'd output metadata) so that output can be run through CEDA's cf-checker, which currently checks up to CF-1.8 - see issue #58 for further details. + +1.0.5 Included fix to cfize_ds.py in order to preserve time dimension when splitting datasets. diff --git a/cfizer/cfize_ds.py b/cfizer/cfize_ds.py index 7831483..fe5d9db 100644 --- a/cfizer/cfize_ds.py +++ b/cfizer/cfize_ds.py @@ -52,7 +52,7 @@ def split_ds( f"splitting dataset {dataset.attrs['title']} by {var}." ) base_title = dataset.attrs["title"].strip("_ +,.&") + "_" - grouped = {point: ds.copy(deep=True) for (point, ds) in dataset.groupby(var)} + grouped = {point: ds.copy(deep=True) for (point, ds) in dataset.groupby(var, squeeze=False)} for point, ds in grouped.items(): # Append relevant coordinate value to title grouped[point].attrs["title"] = base_title + str(int(point)) diff --git a/pyproject.toml b/pyproject.toml index 1582454..37ebff5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "cfizer" -version = "1.0.4" +version = "1.0.5" requires-python = ">=3.9" dependencies = [ "netcdf4>=1.5.7",