From 06f2d6ea52ca658a6c31aff79863d99a609ba7f9 Mon Sep 17 00:00:00 2001 From: Caglar Kucuk Date: Tue, 14 Oct 2025 17:15:17 +0200 Subject: [PATCH 1/4] extend identical unit names --- bris/units.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bris/units.py b/bris/units.py index 70c1753c..1e118be7 100644 --- a/bris/units.py +++ b/bris/units.py @@ -93,9 +93,9 @@ def find_common_name(units: str | None) -> str | None: # Key: common name, value: List of alternative names identical = { - "celsius": ["C", "degC"], + "celsius": ["C", "degC", "°C"], "km/h": ["kmh"], - "kg/m^2": ["mm", "Kg/m^2", "Kg/m2", "kg/m2"], + "kg/m^2": ["mm", "Kg/m^2", "Kg/m2", "kg/m2", "mm/6h", "mm/3h", "mm/1h"], # verif package should be handling the temporal accum window "degree": ["degrees"], "%": ["percent"], } From 762df62209bef826a331ca0cd1e8af9bbe579d4c Mon Sep 17 00:00:00 2001 From: Caglar Kucuk Date: Tue, 14 Oct 2025 17:16:22 +0200 Subject: [PATCH 2/4] add CRS info for ARA --- bris/projections.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bris/projections.py b/bris/projections.py index 3580397a..20e49cae 100644 --- a/bris/projections.py +++ b/bris/projections.py @@ -9,6 +9,7 @@ def get_proj4_str(name: str) -> str: "arome_arctic": "+proj=lcc +lat_0=77.5 +lon_0=-25 +lat_1=77.5 +lat_2=77.5 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs", "norkyst_v3": "+proj=stere +lat_0=90 +lat_ts=60 +lon_0=70 +x_0=3369600 +y_0=1844800 +a=6378137 +b=6356752.3142 +units=m +no_defs +type=crs", "nordic_analysis": "+proj=lcc +lat_0=63.0 +lon_0=15 +lat_1=63.0 +lat_2=63.0 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs", + "ara": "+proj=lcc +lat_0=47.400 +lon_0=13.800 +lat_1=42.981 +lat_2=51.819 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs" }[name] From bce45bced840812d9d18d8299b7d085411c0469e Mon Sep 17 00:00:00 2001 From: Caglar Kucuk Date: Thu, 23 Oct 2025 15:41:45 +0200 Subject: [PATCH 3/4] Remove unnecessary comments and Ruff --- bris/projections.py | 2 +- bris/units.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bris/projections.py b/bris/projections.py index 20e49cae..938ae0e0 100644 --- a/bris/projections.py +++ b/bris/projections.py @@ -9,7 +9,7 @@ def get_proj4_str(name: str) -> str: "arome_arctic": "+proj=lcc +lat_0=77.5 +lon_0=-25 +lat_1=77.5 +lat_2=77.5 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs", "norkyst_v3": "+proj=stere +lat_0=90 +lat_ts=60 +lon_0=70 +x_0=3369600 +y_0=1844800 +a=6378137 +b=6356752.3142 +units=m +no_defs +type=crs", "nordic_analysis": "+proj=lcc +lat_0=63.0 +lon_0=15 +lat_1=63.0 +lat_2=63.0 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs", - "ara": "+proj=lcc +lat_0=47.400 +lon_0=13.800 +lat_1=42.981 +lat_2=51.819 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs" + "ara": "+proj=lcc +lat_0=47.400 +lon_0=13.800 +lat_1=42.981 +lat_2=51.819 +x_0=0 +y_0=0 +R=6371000 +units=m +no_defs +type=crs", }[name] diff --git a/bris/units.py b/bris/units.py index 1e118be7..e4871683 100644 --- a/bris/units.py +++ b/bris/units.py @@ -95,7 +95,7 @@ def find_common_name(units: str | None) -> str | None: identical = { "celsius": ["C", "degC", "°C"], "km/h": ["kmh"], - "kg/m^2": ["mm", "Kg/m^2", "Kg/m2", "kg/m2", "mm/6h", "mm/3h", "mm/1h"], # verif package should be handling the temporal accum window + "kg/m^2": ["mm", "Kg/m^2", "Kg/m2", "kg/m2", "mm/6h", "mm/3h", "mm/1h"], "degree": ["degrees"], "%": ["percent"], } From eb77169bcf267d04b44fc1e51019498f18e785f0 Mon Sep 17 00:00:00 2001 From: caglarkucuk Date: Wed, 29 Oct 2025 17:13:39 +0100 Subject: [PATCH 4/4] Add 'mm/h' to kg/m^2 alternative names --- bris/units.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bris/units.py b/bris/units.py index e4871683..8f99c1aa 100644 --- a/bris/units.py +++ b/bris/units.py @@ -95,7 +95,7 @@ def find_common_name(units: str | None) -> str | None: identical = { "celsius": ["C", "degC", "°C"], "km/h": ["kmh"], - "kg/m^2": ["mm", "Kg/m^2", "Kg/m2", "kg/m2", "mm/6h", "mm/3h", "mm/1h"], + "kg/m^2": ["mm", "Kg/m^2", "Kg/m2", "kg/m2", "mm/6h", "mm/3h", "mm/1h", "mm/h"], "degree": ["degrees"], "%": ["percent"], }