Skip to content

Commit

Permalink
Rename hype to lisflood + unskip slow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Oct 6, 2023
1 parent d13dcbc commit dbfe5a8
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 29 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# eWaterCycle plugin for HYPE hydrological model
# eWaterCycle plugin for LISFLOOD hydrological model

[![Research Software Directory Badge](https://img.shields.io/badge/rsd-00a3e3.svg)](https://www.research-software.nl/software/ewatercycle-hype)
[![Research Software Directory Badge](https://img.shields.io/badge/rsd-00a3e3.svg)](https://www.research-software.nl/software/ewatercycle-lisflood)

HYPE plugin for [eWatercycle](https://ewatercycle.readthedocs.io/).
LISFLOOD plugin for [eWatercycle](https://ewatercycle.readthedocs.io/).

HYPE documentation at http://www.smhi.net/hype/wiki/doku.php .
LISFLOOD documentation at http://www.smhi.net/lisflood/wiki/doku.php .

## Installation

eWaterCycle must be installed in a [mamba](https://conda-forge.org/miniforge/) environment. The environment can be created with

```console
wget https://raw.githubusercontent.com/eWaterCycle/ewatercycle/main/environment.yml
mamba env create --name ewatercycle-hype --file environment.yml
conda activate ewatercycle-hype
mamba env create --name ewatercycle-lisflood --file environment.yml
conda activate ewatercycle-lisflood
```

Install this package alongside your eWaterCycle installation

```console
pip install ewatercycle-hype
pip install ewatercycle-lisflood
```

Then Lisflood becomes available as one of the eWaterCycle models
Expand All @@ -30,9 +30,9 @@ from ewatercycle.models import Lisflood

## Usage

Usage of HYPE forcing generation and model execution is shown in
[docs/generate_forcing.ipynb](https://github.com/eWaterCycle/ewatercycle-hype/tree/main/docs/generate_forcing.ipynb) and [docs/model.ipynb](https://github.com/eWaterCycle/ewatercycle-hype/tree/main/docs/model.ipynb) respectively.
Usage of LISFLOOD forcing generation and model execution is shown in
[docs/generate_forcing.ipynb](https://github.com/eWaterCycle/ewatercycle-lisflood/tree/main/docs/generate_forcing.ipynb) and [docs/model.ipynb](https://github.com/eWaterCycle/ewatercycle-lisflood/tree/main/docs/model.ipynb) respectively.

## License

`ewatercycle-hype` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
`ewatercycle-lisflood` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
6 changes: 3 additions & 3 deletions docs/generate_forcing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:ewatercycle.plugins.lisflood.forcing:target_grid was not given, guestimating from shape\n",
"WARNING:ewatercycle.plugins.lisflood.forcing:Parameter `run_lisvap` is set to False. No forcing data will be generated for 'e0', 'es0' and 'et0'. However, the recipe creates LISVAP input data that can be found in /home/verhoes/git/eWaterCycle/ewatercycle/docs/plugins/lisflood/esmvaltool_output/tmp1gbd6hehrecipe_lisflood_20230801_113928/work/diagnostic_daily/script.\n"
"WARNING:ewatercycle_lisflood.forcing:target_grid was not given, guestimating from shape\n",
"WARNING:ewatercycle_lisflood.forcing:Parameter `run_lisvap` is set to False. No forcing data will be generated for 'e0', 'es0' and 'et0'. However, the recipe creates LISVAP input data that can be found in /home/verhoes/git/eWaterCycle/ewatercycle/docs/plugins/lisflood/esmvaltool_output/tmp1gbd6hehrecipe_lisflood_20230801_113928/work/diagnostic_daily/script.\n"
]
}
],
Expand Down Expand Up @@ -382,7 +382,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:ewatercycle.plugins.lisflood.forcing:target_grid was not given, guestimating from shape\n"
"WARNING:ewatercycle_lisflood.forcing:target_grid was not given, guestimating from shape\n"
]
}
],
Expand Down
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/ewatercycle_hype/__init__.py"
path = "src/ewatercycle_lisflood/__init__.py"

[project]
name = "ewatercycle-hype"
description = "eWaterCycle plugin for HYPE hydrological model"
name = "ewatercycle-lisflood"
description = "eWaterCycle plugin for LISFLOOD hydrological model"
readme = "README.md"
license = "Apache-2.0"
authors = [
Expand All @@ -31,6 +31,8 @@ dynamic = ["version"]

# This registers the plugin such that it is discoverable by eWaterCycle
[project.entry-points."ewatercycle.models"]
Lisflood = "ewatercycle_hype.model:Lisflood"
Lisflood = "ewatercycle_lisflood.model:Lisflood"
[project.entry-points."ewatercycle.forcings"]
LisfloodForcing = "ewatercycle_hype.forcing:LisfloodForcing"
LisfloodForcing = "ewatercycle_lisflood.forcing:LisfloodForcing"
[project.entry-points."ewatercycle.parameter_sets"]
lisflood_fraser = "ewatercycle_lisflood.parameter_sets:lisflood_fraser"
1 change: 1 addition & 0 deletions src/ewatercycle_lisflood/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1"
2 changes: 1 addition & 1 deletion src/ewatercycle_lisflood/forcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ewatercycle.base.forcing import DefaultForcing
from ewatercycle.esmvaltool.builder import RecipeBuilder
from ewatercycle.esmvaltool.schema import Dataset, Recipe, TargetGrid
from ewatercycle.plugins.lisflood.lisvap import create_lisvap_config, lisvap
from ewatercycle_lisflood.lisvap import create_lisvap_config, lisvap
from ewatercycle.util import (
fit_extents_to_grid,
get_extents,
Expand Down
2 changes: 1 addition & 1 deletion src/ewatercycle_lisflood/lisvap.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from ewatercycle import CFG
from ewatercycle.container import ContainerEngine, ContainerImage
from ewatercycle.plugins.lisflood.config import XmlConfig
from ewatercycle_lisflood.config import XmlConfig
from ewatercycle.util import get_time

# TODO: get rid of this part.
Expand Down
4 changes: 2 additions & 2 deletions src/ewatercycle_lisflood/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from ewatercycle.base.model import ISO_TIMEFMT, ContainerizedModel
from ewatercycle.base.parameter_set import ParameterSet
from ewatercycle.container import ContainerImage
from ewatercycle.plugins.lisflood.config import XmlConfig
from ewatercycle.plugins.lisflood.forcing import LisfloodForcing
from ewatercycle_lisflood.config import XmlConfig
from ewatercycle_lisflood.forcing import LisfloodForcing
from ewatercycle.util import get_time, to_absolute_path

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_forcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_lisflood_recipe
from ewatercycle_lisflood.forcing import LisfloodForcing, build_lisflood_recipe
from ewatercycle.testing.helpers import reyamlify


Expand Down
4 changes: 2 additions & 2 deletions tests/test_lisvap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from unittest.mock import patch

from ewatercycle import CFG
from ewatercycle.plugins.lisflood.config import XmlConfig
from ewatercycle.plugins.lisflood.lisvap import create_lisvap_config, lisvap
from ewatercycle_lisflood.config import XmlConfig
from ewatercycle_lisflood.lisvap import create_lisvap_config, lisvap


def find_values_in_xml(tree, name):
Expand Down
7 changes: 3 additions & 4 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from ewatercycle.base.parameter_set import ParameterSet
from ewatercycle.forcing import sources
from ewatercycle.parameter_sets import example_parameter_sets
from ewatercycle.plugins.lisflood.config import XmlConfig
from ewatercycle.plugins.lisflood.forcing import LisfloodForcing
from ewatercycle.plugins.lisflood.model import Lisflood
from ewatercycle_lisflood.config import XmlConfig
from ewatercycle_lisflood.forcing import LisfloodForcing
from ewatercycle_lisflood.model import Lisflood
from ewatercycle.testing.fake_models import FailingModel


Expand Down Expand Up @@ -45,7 +45,6 @@ def find_values_in_xml(tree, name):
# we could make it quicker by creating
# a fake parameter set and forcing,
# but then how do we make sure the fakes are correct?
@pytest.mark.skip("Too slow")
class TestLFlatlonUseCase:
@pytest.fixture(scope="session")
def parameterset(self, mocked_config):
Expand Down

0 comments on commit dbfe5a8

Please sign in to comment.