ewatercycle.models.abstract module
- class ewatercycle.models.abstract.AbstractModel(version: str, parameter_set: Optional[ParameterSet] = None, forcing: Optional[ForcingT] = None)
Bases:
Generic
[ForcingT
]Abstract class of a eWaterCycle model.
- available_versions: ClassVar[Tuple[str, ...]] = ()
Versions of model that are available in this class
- bmi: basic_modeling_interface.Bmi
Basic Modeling Interface object
- abstract setup(*args, **kwargs) Tuple[str, str]
Performs model setup.
Creates config file and config directory
Start bmi container and store as self.bmi
- Parameters
*args – Positional arguments. Sub class should specify each arg.
**kwargs – Named arguments. Sub class should specify each arg.
- Returns
Path to config file and path to config directory
- initialize(config_file: str) None
Initialize the model.
- Parameters
config_file – Name of initialization file.
- get_value(name: str) numpy.ndarray
Get a copy of values of the given variable.
- Parameters
name – Name of variable
- get_value_at_coords(name, lat: Iterable[float], lon: Iterable[float]) numpy.ndarray
Get a copy of values of the given variable at lat/lon coordinates.
- Parameters
name – Name of variable
lat – Latitudinal value
lon – Longitudinal value
- set_value(name: str, value: numpy.ndarray) None
Specify a new value for a model variable.
- Parameters
name – Name of variable
value – The new value for the specified variable.
- set_value_at_coords(name: str, lat: Iterable[float], lon: Iterable[float], values: numpy.ndarray) None
Specify a new value for a model variable at at lat/lon coordinates.
- Parameters
name – Name of variable
lat – Latitudinal value
lon – Longitudinal value
values – The new value for the specified variable.
- abstract get_value_as_xarray(name: str) xarray.DataArray
Get a copy values of the given variable as xarray DataArray.
The xarray object also contains coordinate information and additional attributes such as the units.
Args: name: Name of the variable
- property start_time_as_isostr: str
Start time of the model.
In UTC and ISO format string e.g. ‘YYYY-MM-DDTHH:MM:SSZ’.
- property end_time_as_isostr: str
End time of the model.
In UTC and ISO format string e.g. ‘YYYY-MM-DDTHH:MM:SSZ’.