ewatercycle.models
Collection of models available in eWaterCycle.
Examples
To instantiate a model:
>>> from ewatercycle.models import Wflow
>>> model = Wflow()
# Alternativly import it directly from plugin with
>>> from ewaterycecle.plugins.wlow.model import Wflow
To list all available models:
>>> from ewatercycle.models import sources
>>> sources
# Returns dictionary containing models
To get your own model to be listed here it needs to be
registered in the ewatercycle.models
entry point group.
Module Contents
- ewatercycle.models.get_package_name(module_name: str) str
Get the (pip) package name from a module name.
Note: falls back to [unknown] if the lookup fails.
- ewatercycle.models.pkg_name
- class ewatercycle.models.ModelSources
Bases:
ewatercycle.shared.Sources
Dictionary filled with available models.
Examples
Get a nice overview of the available models:
>>> from ewatercycle.models import sources >>> print(sources) ...
List the names of the available models:
>>> from ewatercycle.models import sources >>> sources.keys() ['Wflow', 'LeakyBucket', ...]
Access one of the models:
>>> from ewatercycle.models import sources >>> sources["Wflow"] model = sources["Wflow"]()
To get your own model to be listed here it needs to be registered in the ewatercycle.models entry point group .
- ewatercycle.models.sources