hmp.open()#
- Command line
hmp show,hmp export - Returns
Project,Run,Session,Workspace - Defined in
hydromodpy/project/api.py
- open(path)[source]#
Open what a path stands for: a project, a run, a session or a workspace.
a project directory, its
project.tomlor any folder inside it gives aProject, read only;a run directory gives a
Run, partial before its seal (record,checks,inputsandlabel()refuse);a session directory (
sessions/<name>) gives aSession;a workspace root (
workspace.tomlorprojects/) gives aWorkspace.
A run and a session are given
hydromodpy.project.show.render(), sorun.figure(name)draws. They are opened byopen_run_dir(path, *, read_config, render)andSession(path, *, read_config, render).- Parameters:
path (PathLike) – The directory or file.
- Returns:
Project or Run or Session or Workspace – What the path stands for.
- Raises:
FileNotFoundError – If the path does not exist, or stands for none of the above.
hydromodpy.results.errors.RunNotSealedError – If the path is a run directory that wrote no facts.
- Return type:
Examples
>>> import hydromodpy as hmp >>> proj = hmp.open("~/ws/projects/bretagne_k") >>> run = hmp.open("~/ws/projects/bretagne_k/runs/J0014010-base")