From 384ef751a8cc21a2a3af7b452cc0b00eec2233fc Mon Sep 17 00:00:00 2001 From: Daniele Branchini Date: Thu, 31 Mar 2022 17:15:42 +0200 Subject: [PATCH] renamed alt0 to hzero (ref. #5) --- doc/INPUTS.rst | 12 ++++++------ doc/recipes/{alt0.md => hzero.md} | 10 +++++----- recipes/{alt0.yaml => hzero.yaml} | 14 +++++++------- .../cosmo_hzero_2021_1_10_0_0_0+12.arkimet} | Bin .../ifs_hzeroground_2021_1_10_0_0_0+12.arkimet} | Bin .../ifs_z_2021_1_10_0_0_0+0.arkimet | Bin tests/{test_alt0.py => test_hzero.py} | 16 ++++++++-------- tests/test_inputs.py | 10 +++++----- 8 files changed, 31 insertions(+), 31 deletions(-) rename doc/recipes/{alt0.md => hzero.md} (95%) rename recipes/{alt0.yaml => hzero.yaml} (91%) rename testdata/{alt0/cosmo_alt0_2021_1_10_0_0_0+12.arkimet => hzero/cosmo_hzero_2021_1_10_0_0_0+12.arkimet} (100%) rename testdata/{alt0/ifs_alt0ground_2021_1_10_0_0_0+12.arkimet => hzero/ifs_hzeroground_2021_1_10_0_0_0+12.arkimet} (100%) rename testdata/{alt0 => hzero}/ifs_z_2021_1_10_0_0_0+0.arkimet (100%) rename tests/{test_alt0.py => test_hzero.py} (67%) diff --git a/doc/INPUTS.rst b/doc/INPUTS.rst index 6a50ded..d6e1f5e 100644 --- a/doc/INPUTS.rst +++ b/doc/INPUTS.rst @@ -247,11 +247,11 @@ Due to internal optimization, the second input value is not available in the Example:: - alt0: + hzero: - model: ifs type: groundtomsl - inputs: [z, alt0ground] - clip: "alt0[alt0 < z] = -999" + inputs: [z, hzeroground] + clip: "hzero[hzero <= z] = -999" grib_set: shortName: deg0l @@ -306,11 +306,11 @@ postprocess it before writing it out. Example:: - alt0: + hzero: - model: ifs type: groundtomsl - inputs: [z, alt0ground] - clip: "alt0[alt0 < z] = -999" + inputs: [z, hzeroground] + clip: "hzero[hzero <= z] = -999" diff --git a/doc/recipes/alt0.md b/doc/recipes/hzero.md similarity index 95% rename from doc/recipes/alt0.md rename to doc/recipes/hzero.md index 6c37494..8e34511 100644 --- a/doc/recipes/alt0.md +++ b/doc/recipes/hzero.md @@ -1,4 +1,4 @@ -# alt0: Altezza dello zero termico +# hzero: Height of zero degree level Mixer: **default** @@ -8,13 +8,13 @@ for IFS model it needs both "deg0l" and "z" variables ## Inputs -* **alt0**: +* **hzero**: * Model **cosmo**: * **Arkimet matcher**: `product:GRIB1,80,201,84;level:GRIB1,4` * **grib_filter matcher**: `shortName is "hzerocl"` * Model **ifs**: * **Preprocessing**: groundtomsl - * **Inputs**: z, alt0ground + * **Inputs**: z, hzeroground ## Steps @@ -44,7 +44,7 @@ Add a grib file With arguments: ``` { - "grib": "alt0" + "grib": "hzero" } ``` @@ -133,7 +133,7 @@ With arguments: "legend": true, "legend_display_type": "continuous", "legend_title": true, - "legend_title_text": "Altezza dello zero termico (m)", + "legend_title_text": "Height of zero degree level (m)", "legend_text_colour": "black", "legend_text_font_size": 0.4, "legend_title_font_size": 0.5, diff --git a/recipes/alt0.yaml b/recipes/hzero.yaml similarity index 91% rename from recipes/alt0.yaml rename to recipes/hzero.yaml index e128f80..72b6f8a 100644 --- a/recipes/alt0.yaml +++ b/recipes/hzero.yaml @@ -1,8 +1,8 @@ --- -description: Altezza dello zero termico +description: Height of zero degree level notes: for IFS model it needs both "deg0l" and "z" variables inputs: - alt0ground: + hzeroground: - model: ifs arkimet: product:GRIB1,98,228,24;level:GRIB1,1 eccodes: shortName is "deg0l" @@ -10,21 +10,21 @@ inputs: - model: ifs arkimet: product:GRIB1,98,128,129;level:GRIB1,1 eccodes: shortName is "z" - alt0: + hzero: - model: cosmo arkimet: product:GRIB1,80,201,84;level:GRIB1,4 eccodes: shortName is "hzerocl" - model: ifs type: groundtomsl - inputs: [z, alt0ground] - clip: "alt0[alt0 <= z] = -999" + inputs: [z, hzeroground] + clip: "hzero[hzero <= z] = -999" grib_set: shortName: deg0l recipe: - step: add_basemap - step: add_coastlines_bg - step: add_grib - grib: alt0 + grib: hzero - step: add_contour params: contour: off @@ -47,7 +47,7 @@ recipe: legend: on legend_display_type: continuous legend_title: on - legend_title_text: "Altezza dello zero termico (m)" + legend_title_text: "Height of zero degree level (m)" legend_text_colour: black legend_text_font_size: 0.4 legend_title_font_size: 0.5 diff --git a/testdata/alt0/cosmo_alt0_2021_1_10_0_0_0+12.arkimet b/testdata/hzero/cosmo_hzero_2021_1_10_0_0_0+12.arkimet similarity index 100% rename from testdata/alt0/cosmo_alt0_2021_1_10_0_0_0+12.arkimet rename to testdata/hzero/cosmo_hzero_2021_1_10_0_0_0+12.arkimet diff --git a/testdata/alt0/ifs_alt0ground_2021_1_10_0_0_0+12.arkimet b/testdata/hzero/ifs_hzeroground_2021_1_10_0_0_0+12.arkimet similarity index 100% rename from testdata/alt0/ifs_alt0ground_2021_1_10_0_0_0+12.arkimet rename to testdata/hzero/ifs_hzeroground_2021_1_10_0_0_0+12.arkimet diff --git a/testdata/alt0/ifs_z_2021_1_10_0_0_0+0.arkimet b/testdata/hzero/ifs_z_2021_1_10_0_0_0+0.arkimet similarity index 100% rename from testdata/alt0/ifs_z_2021_1_10_0_0_0+0.arkimet rename to testdata/hzero/ifs_z_2021_1_10_0_0_0+0.arkimet diff --git a/tests/test_alt0.py b/tests/test_hzero.py similarity index 67% rename from tests/test_alt0.py rename to tests/test_hzero.py index b6936b1..3c6100e 100644 --- a/tests/test_alt0.py +++ b/tests/test_hzero.py @@ -2,9 +2,9 @@ from arkimapslib.unittest import add_recipe_test_cases -class ALT0CosmoMixin: +class HZEROCosmoMixin: def test_process(self): - self.fill_pantry(expected=["cosmo_alt0_2021_1_10_0_0_0+12.grib"]) + self.fill_pantry(expected=["cosmo_hzero_2021_1_10_0_0_0+12.grib"]) orders = self.make_orders() self.assertEqual(len(orders), 1) @@ -16,11 +16,11 @@ def test_process(self): self.assertMgribArgsEqual(orders[0], cosmo={}, ifs={}) -class ALT0IFSMixin: +class HZEROIFSMixin: def test_process(self): self.maxDiff = None self.fill_pantry(expected=[ - "ifs_alt0ground_2021_1_10_0_0_0+12.grib", + "ifs_hzeroground_2021_1_10_0_0_0+12.grib", "ifs_z_2021_1_10_0_0_0+0.grib", ]) @@ -28,10 +28,10 @@ def test_process(self): self.assertEqual(len(orders), 1) self.assertProcessLogEqual( - ["alt0:GroundToMSL:groundtomsl" + ["hzero:GroundToMSL:groundtomsl" " ifs_z_2021_1_10_0_0_0+0.grib" - " ifs_alt0ground_2021_1_10_0_0_0+12.grib" - " ifs_alt0_2021_1_10_0_0_0+12.grib"] + " ifs_hzeroground_2021_1_10_0_0_0+12.grib" + " ifs_hzero_2021_1_10_0_0_0+12.grib"] ) self.assertRenders(orders[0]) @@ -39,4 +39,4 @@ def test_process(self): self.assertMgribArgsEqual(orders[0], cosmo={}, ifs={}) -add_recipe_test_cases(__name__, "alt0") +add_recipe_test_cases(__name__, "hzero") diff --git a/tests/test_inputs.py b/tests/test_inputs.py index dadd0aa..1516769 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -79,12 +79,12 @@ def test_trim(self): def test_apply_clip(self): class Tester(arkimapslib.inputs.GribSetMixin): def __init__(self, clip: str): - self.name = "alt0" + self.name = "hzero" self.defined_in = __file__ super().__init__(clip=clip) - o = Tester(clip="alt0[alt0 < z] = -999") - alt0 = numpy.array([1, 2, 3, 4]) + o = Tester(clip="hzero[hzero < z] = -999") + hzero = numpy.array([1, 2, 3, 4]) z = numpy.array([4, 3, 2, 1]) - alt0 = o.apply_clip({"alt0": alt0, "z": z}) - self.assertEqual(alt0.tolist(), [-999, -999, 3, 4]) + hzero = o.apply_clip({"hzero": hzero, "z": z}) + self.assertEqual(hzero.tolist(), [-999, -999, 3, 4])