diff --git a/pyproject.toml b/pyproject.toml index 951ce53..2ab3f93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pytrajplot" -version = "2.1.1" +version = "2.1.2" license = "BSD-3-Clause" authors = ["Michel Zeller", "Marco Ketzel", "Pirmin Kaufmann ", "Peider Könz", "Victoria Cherkas", "Paulina Grochal"] description = "Plot LAGRANTO trajectories starting/ending at the same location on a map together with vertical cross sections" diff --git a/pytrajplot/utils.py b/pytrajplot/utils.py index 86a92a1..e3c8c76 100644 --- a/pytrajplot/utils.py +++ b/pytrajplot/utils.py @@ -2,6 +2,7 @@ # Standard library import logging +import os _PRODUCT_TYPE_MAP: dict[str, str] = { "ICON-CH1-EPS": "forecast-iconch1eps-trajectories", @@ -13,10 +14,14 @@ def get_product_type(model_name: str) -> str: """Derive the product_type identifier from a model name. Falls back to a generated name if the model is not in the map. + Appends a suffix when PRODUCT_TYPE_SUFFIX is set (e.g. '-test'). """ product_type = _PRODUCT_TYPE_MAP.get(model_name.upper()) if product_type is None: product_type = f"forecast-{model_name.lower().replace('-', '')}-trajectories" + suffix = os.environ.get("PRODUCT_TYPE_SUFFIX", "") + if suffix: + product_type += suffix return product_type