5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1"""!
2Python bindings of mHM.
3
4@copyright Copyright 2005-@today, the mHM Developers, Luis Samaniego, Sabine Attinger: All rights reserved.
5 mHM is released under the LGPLv3+ license @license_note
6"""
7
8##
9# @dir pybind
10# @brief @copybrief mhm
11# @details @copydetails mhm
12#
13# @dir mhm
14# @brief mhm Python package
15# @details @copydetails mhm
16#
17# @defgroup mhm mhm - Python bindings
18# @brief Python wrapper to control mHM.
19# @details The mhm python package provides a wrapper module to control mHM from Python.
20# This includes:
21# - initialization, running and finalizing a model run
22# - control of time stepping
23# - access to internal variables
24
25from . import cli, download
26from .download import download_test
27from .tools import (
28 get_mask,
29 get_parameter,
30 get_runoff,
31 get_runoff_eval,
32 get_variable,
33 set_meteo,
34)
35from .wrapper import get, model, run, set
36
37try:
38 from ._version import __version__
39except ModuleNotFoundError: # pragma: no cover
40 # package is not installed
41 __version__ = "0.0.0.dev0"
42
43
44def __getattr__(name):
45 """Magic method to provide 'f_version' in Python."""
46 if name == "f_version":
47 return model.version().decode("utf-8").strip()
48 raise AttributeError(f"module {__name__} has no attribute {name}")
49
50
51__all__ = [
52 "cli",
53 "model",
54 "get",
55 "set",
56 "run",
57 "download",
58 "download_test",
59 "f_version",
60 "get_runoff",
61 "get_variable",
62 "get_runoff_eval",
63 "get_parameter",
64 "get_mask",
65 "set_meteo",
66 "__version__",
67]
__getattr__(name)
Magic method to provide 'f_version' in Python.
Definition __init__.py:44
subroutine version(ver_string)
Get the mHM version.
Definition wrapper.f90:144