diff --git a/src/ewatercycle/plugins/hype/forcing.py b/src/ewatercycle/plugins/hype/forcing.py index 83c91c61..ff1cc1c6 100644 --- a/src/ewatercycle/plugins/hype/forcing.py +++ b/src/ewatercycle/plugins/hype/forcing.py @@ -43,7 +43,7 @@ def _build_recipe( dataset: Dataset | str | dict, **model_specific_options ): - return build_recipe( + return build_hype_recipe( start_year=start_time.year, end_year=end_time.year, shape=shape, @@ -85,7 +85,7 @@ def to_xarray(self) -> xr.Dataset: return ds -def build_recipe( +def build_hype_recipe( start_year: int, end_year: int, shape: Path, diff --git a/src/ewatercycle/plugins/lisflood/forcing.py b/src/ewatercycle/plugins/lisflood/forcing.py index 3fdd8b79..366850cf 100644 --- a/src/ewatercycle/plugins/lisflood/forcing.py +++ b/src/ewatercycle/plugins/lisflood/forcing.py @@ -129,7 +129,7 @@ def generate( # type: ignore # Cannot call super as we want recipe_output not forcing object start_year = get_time(start_time).year end_year = get_time(end_time).year - recipe = build_recipe( + recipe = build_lisflood_recipe( start_year=start_year, end_year=end_year, shape=Path(shape), @@ -222,7 +222,7 @@ def generate( # type: ignore return generated_forcing -def build_recipe( +def build_lisflood_recipe( start_year: int, end_year: int, shape: Path, diff --git a/src/ewatercycle/plugins/marrmot/forcing.py b/src/ewatercycle/plugins/marrmot/forcing.py index 54ec9edf..9d5a5f3c 100644 --- a/src/ewatercycle/plugins/marrmot/forcing.py +++ b/src/ewatercycle/plugins/marrmot/forcing.py @@ -69,7 +69,7 @@ def _build_recipe( dataset: Dataset | str | dict, **model_specific_options, ): - return build_recipe( + return build_marrmot_recipe( start_year=start_time.year, end_year=end_time.year, shape=shape, @@ -137,7 +137,7 @@ def to_xarray(self) -> xr.Dataset: ) -def build_recipe( +def build_marrmot_recipe( start_year: int, end_year: int, shape: Path, diff --git a/src/ewatercycle/plugins/pcrglobwb/forcing.py b/src/ewatercycle/plugins/pcrglobwb/forcing.py index 9c3db8de..c356e148 100644 --- a/src/ewatercycle/plugins/pcrglobwb/forcing.py +++ b/src/ewatercycle/plugins/pcrglobwb/forcing.py @@ -127,7 +127,7 @@ def _build_recipe( start_time_climatology = model_specific_options["start_time_climatology"] end_time_climatology = model_specific_options["end_time_climatology"] extract_region = model_specific_options["extract_region"] - return build_recipe( + return build_pcrglobwb_recipe( start_year=start_time.year, end_year=end_time.year, shape=shape, @@ -146,7 +146,7 @@ def _recipe_output_to_forcing_arguments(cls, recipe_output, model_specific_optio } -def build_recipe( +def build_pcrglobwb_recipe( start_year: int, end_year: int, shape: Path, diff --git a/src/ewatercycle/plugins/wflow/forcing.py b/src/ewatercycle/plugins/wflow/forcing.py index 95d47ada..e5ac4214 100644 --- a/src/ewatercycle/plugins/wflow/forcing.py +++ b/src/ewatercycle/plugins/wflow/forcing.py @@ -88,7 +88,7 @@ def _build_recipe( **model_specific_options ): extract_region = model_specific_options["extract_region"] - return build_recipe( + return build_wflow_recipe( start_year=start_time.year, end_year=end_time.year, shape=shape, @@ -105,7 +105,7 @@ def _recipe_output_to_forcing_arguments(cls, recipe_output, model_specific_optio } -def build_recipe( +def build_wflow_recipe( start_year: int, end_year: int, shape: Path, diff --git a/tests/plugins/hype/test_forcing.py b/tests/plugins/hype/test_forcing.py index 36be8438..36292773 100644 --- a/tests/plugins/hype/test_forcing.py +++ b/tests/plugins/hype/test_forcing.py @@ -9,7 +9,7 @@ from esmvalcore.experimental.recipe_output import RecipeOutput from ewatercycle.base.forcing import FORCING_YAML -from ewatercycle.plugins.hype.forcing import HypeForcing, build_recipe +from ewatercycle.plugins.hype.forcing import HypeForcing, build_hype_recipe from ewatercycle.testing.helpers import reyamlify @@ -154,8 +154,8 @@ def test_with_directory(mock_recipe_run, sample_shape, tmp_path): assert mock_recipe_run["session"].session_dir == forcing_dir -def test_build_recipe(sample_shape: str): - recipe = build_recipe( +def test_build_hype_recipe(sample_shape: str): + recipe = build_hype_recipe( dataset="ERA5", start_year=1990, end_year=2001, diff --git a/tests/plugins/lisflood/test_forcing.py b/tests/plugins/lisflood/test_forcing.py index 85d8fb7c..c9534809 100644 --- a/tests/plugins/lisflood/test_forcing.py +++ b/tests/plugins/lisflood/test_forcing.py @@ -9,7 +9,7 @@ from esmvalcore.experimental.recipe_output import DataFile, RecipeOutput from ewatercycle.base.forcing import FORCING_YAML -from ewatercycle.plugins.lisflood.forcing import LisfloodForcing, build_recipe +from ewatercycle.plugins.lisflood.forcing import LisfloodForcing, build_lisflood_recipe from ewatercycle.testing.helpers import reyamlify @@ -240,8 +240,8 @@ def test_load_legacy_forcing(tmp_path): assert result == expected -def test_build_recipe_with_targetgrid(sample_shape: str): - recipe = build_recipe( +def test_build_lisflood_recipe_with_targetgrid(sample_shape: str): + recipe = build_lisflood_recipe( dataset="ERA5", start_year=1990, end_year=2001, @@ -465,8 +465,8 @@ def test_build_recipe_with_targetgrid(sample_shape: str): assert recipe_as_string == reyamlify(expected) -def test_build_recipe_without_targetgrid(sample_shape: str): - recipe = build_recipe( +def test_build_lisflood_recipe_without_targetgrid(sample_shape: str): + recipe = build_lisflood_recipe( dataset="ERA5", start_year=1990, end_year=2001, diff --git a/tests/plugins/marrmot/test_forcing.py b/tests/plugins/marrmot/test_forcing.py index 2d3d8fa9..72dc97b3 100644 --- a/tests/plugins/marrmot/test_forcing.py +++ b/tests/plugins/marrmot/test_forcing.py @@ -8,7 +8,7 @@ from esmvalcore.experimental.recipe_output import RecipeOutput from ewatercycle.base.forcing import FORCING_YAML -from ewatercycle.plugins.marrmot.forcing import MarrmotForcing, build_recipe +from ewatercycle.plugins.marrmot.forcing import MarrmotForcing, build_marrmot_recipe from ewatercycle.testing.helpers import reyamlify @@ -240,8 +240,8 @@ def test_load_legacy_forcing(tmp_path): assert result == expected -def test_build_recipe(sample_shape: str): - recipe = build_recipe( +def test_build_marrmot_recipe(sample_shape: str): + recipe = build_marrmot_recipe( dataset="ERA5", start_year=1990, end_year=2001, diff --git a/tests/plugins/pcrglobwb/test_forcing.py b/tests/plugins/pcrglobwb/test_forcing.py index afa235b0..3a17dfca 100644 --- a/tests/plugins/pcrglobwb/test_forcing.py +++ b/tests/plugins/pcrglobwb/test_forcing.py @@ -7,7 +7,10 @@ from esmvalcore.experimental.recipe_output import RecipeOutput from ewatercycle.base.forcing import FORCING_YAML -from ewatercycle.plugins.pcrglobwb.forcing import PCRGlobWBForcing, build_recipe +from ewatercycle.plugins.pcrglobwb.forcing import ( + PCRGlobWBForcing, + build_pcrglobwb_recipe, +) from ewatercycle.testing.helpers import create_netcdf, reyamlify from ewatercycle.util import get_extents @@ -147,8 +150,8 @@ def test_load_legacy_forcing(tmp_path): assert result == expected -def test_build_recipe(sample_shape: str): - recipe = build_recipe( +def test_build_pcrglobwb_recipe(sample_shape: str): + recipe = build_pcrglobwb_recipe( start_year=1990, end_year=2001, shape=Path(sample_shape), @@ -250,9 +253,9 @@ def test_build_recipe(sample_shape: str): assert recipe_as_string == reyamlify(expected) -def test_build_recipe_with_region(sample_shape: str): +def test_build_pcrglobwb_recipe_with_region(sample_shape: str): extents = get_extents(sample_shape, 2) - recipe = build_recipe( + recipe = build_pcrglobwb_recipe( start_year=1990, end_year=2001, shape=Path(sample_shape), diff --git a/tests/plugins/wflow/test_forcing.py b/tests/plugins/wflow/test_forcing.py index c65cce6a..197657ae 100644 --- a/tests/plugins/wflow/test_forcing.py +++ b/tests/plugins/wflow/test_forcing.py @@ -9,7 +9,7 @@ from esmvalcore.experimental.recipe_output import RecipeOutput from ewatercycle.base.forcing import FORCING_YAML -from ewatercycle.plugins.wflow.forcing import WflowForcing, build_recipe +from ewatercycle.plugins.wflow.forcing import WflowForcing, build_wflow_recipe from ewatercycle.testing.helpers import create_netcdf, reyamlify @@ -231,8 +231,8 @@ def test_load_legacy_forcing(tmp_path): assert result == expected -def test_build_recipe(sample_shape: str): - recipe = build_recipe( +def test_build_wflow_recipe(sample_shape: str): + recipe = build_wflow_recipe( dataset="ERA5", start_year=1990, end_year=2001,