From 19f69fe8c163875336e291278ce2b47c06b84b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCtschow?= Date: Thu, 21 Nov 2024 08:42:18 +0100 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mika Pflüger --- docs/source/usage/csg.md | 4 ++-- primap2/csg/_wrapper.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/source/usage/csg.md b/docs/source/usage/csg.md index 7d51087..f3b9297 100644 --- a/docs/source/usage/csg.md +++ b/docs/source/usage/csg.md @@ -170,7 +170,7 @@ lower-priority timeseries was used to fill the holes. The {py:func}`primap2.csg.compose` function creates a composite time series according to the given priorities and strategies, but it does not take care of pre- and postprocessing of the data. It will carry along unnecessary data and the resulting dataset will miss the -priority coordinates. The {py:func}`primap2.csg.create_composite_source` function takes acre +priority coordinates. The {py:func}`primap2.csg.create_composite_source` function takes care of these steps and prepares the input data and completes the output data to a primap2 dataset with all desired dimensions and metadata. @@ -178,7 +178,7 @@ The function takes the same inputs as {py:func}`primap2.csg.compose` with additi define pre- and postprocessing: * **result_prio_coords** Defines the vales for the priority coordinates in the output dataset. As the -priority coordinates differ for all input sources there is no canonical vale +priority coordinates differ for all input sources there is no canonical value for the result and it has to be explicitly defined * **metadata** Set metadata values such as title and references diff --git a/primap2/csg/_wrapper.py b/primap2/csg/_wrapper.py index da6d4ce..a62aee3 100644 --- a/primap2/csg/_wrapper.py +++ b/primap2/csg/_wrapper.py @@ -18,10 +18,7 @@ def set_priority_coords( """ for dim in dims.keys(): - if "terminology" in dims[dim].keys(): - terminology = dims[dim]["terminology"] - else: - terminology = None + terminology = dims[dim].get("terminology", None) ds = ds.pr.expand_dims(dim=dim, coord_value=dims[dim]["value"], terminology=terminology) return ds