ravenpy package
A Python package to help run Raven, the hydrologic modelling framework.
Subpackages
- ravenpy.cli package
- ravenpy.config package
- Subpackages
- ravenpy.config.emulators package
- Submodules
- ravenpy.config.emulators.blended module
- ravenpy.config.emulators.canadianshield module
- ravenpy.config.emulators.gr4jcn module
- ravenpy.config.emulators.hbvec module
- ravenpy.config.emulators.hmets module
- ravenpy.config.emulators.hypr module
- ravenpy.config.emulators.mohyse module
- ravenpy.config.emulators.routing module
- ravenpy.config.emulators.sacsma module
- ravenpy.config.emulators package
- Submodules
- ravenpy.config.base module
- ravenpy.config.commands module
- ravenpy.config.conventions module
- ravenpy.config.defaults module
- ravenpy.config.options module
- ravenpy.config.parsers module
- ravenpy.config.processes module
- ravenpy.config.rvs module
- ravenpy.config.utils module
- Subpackages
- ravenpy.extractors package
- ravenpy.utilities package
- Submodules
- ravenpy.utilities.analysis module
- ravenpy.utilities.calibration module
- ravenpy.utilities.checks module
- ravenpy.utilities.coords module
- ravenpy.utilities.forecasting module
- ravenpy.utilities.geo module
- ravenpy.utilities.geoserver module
- ravenpy.utilities.graphs module
- ravenpy.utilities.io module
- ravenpy.utilities.mk_test module
- ravenpy.utilities.nb_graphs module
- ravenpy.utilities.ravenio module
- ravenpy.utilities.regionalization module
- ravenpy.utilities.testdata module
Submodules
ravenpy.__version__ module
ravenpy.ravenpy module
Main module.
- class ravenpy.ravenpy.Emulator(config: Config, workdir: str | PathLike | None = None, modelname: str | None = None, overwrite: bool = False)[source]
Bases:
object
- property config: Config
Read-only model configuration.
- property modelname: str
File name stem of configuration files.
- property output: OutputReader
Return simulation output object.
- property output_path: Path | None
Path to model outputs.
- resume(timestamp: bool = True) Config [source]
Return new model configuration using state variables from the end of the run.
- timestamp: bool
If False, ignore time stamp information in the solution. If True, the solution will set StartDate to the solution’s timestamp.
- run(overwrite: bool = False) OutputReader [source]
Run the model. This will write RV files if not already done.
- Parameters:
overwrite (bool) – If True, overwrite existing files.
- property workdir: Path
Path to RV files and output subdirectory.
- class ravenpy.ravenpy.EnsembleReader(*, run_name: str | None = None, paths: List[str | PathLike] | None = None, runs: List[OutputReader] | None = None, dim: str = 'member')[source]
Bases:
object
- property files
- property hydrograph
- property storage
- class ravenpy.ravenpy.OutputReader(run_name: str | None = None, path: str | Path | None = None)[source]
Bases:
object
- property diagnostics: dict | None
Return model diagnostics.
- property files: dict
Return paths to output files.
- property hydrograph: Dataset
Return the hydrograph.
- property messages: str | None
- property path: Path
Path to output directory.
- property solution: dict | None
Return solution file content.
- property storage: Dataset
Return the storage variables.
- exception ravenpy.ravenpy.RavenError[source]
Bases:
Exception
This is an error that is meant to be raised whenever a message of type “ERROR” is found in the Raven_errors.txt file resulting from a Raven (i.e. the C program) run.
- exception ravenpy.ravenpy.RavenWarning[source]
Bases:
Warning
This is a warning corresponding to a message of type “WARNING” in the Raven_errors.txt file resulting from a Raven (i.e. the C program) run.
- ravenpy.ravenpy.run(modelname: str, configdir: str | Path, outputdir: str | Path | None = None, overwrite: bool = True, verbose: bool = False) Path [source]
Run Raven given the path to an existing model configuration.
- Parameters:
modelname (str) – Configuration files stem, i.e. the file name without extension.
configdir (Path or str) – Path to configuration files directory.
outputdir (Path or str, optional) – Path to model simulation output. If None, will write to configdir/output.
overwrite (bool) – If True, overwrite existing files.
verbose (bool) – If True, always display Raven warnings. If False, warnings will only be printed if an error occurs.
- Returns:
Path to model outputs.
- Return type:
Path