open#
- hydromodpy.open(workspace, *, create=False)[source]#
Open a HydroModPy project catalog.
The single door to a workspace catalog: returns a
hydromodpy.results.catalog.SimulationCatalogbacked bycatalog.duckdb. It exposes object access (latest,best,find,cat[ref]), tabular access (frame,sql,list_simulations), schema discovery (describe,tables,columns,variables,metrics,stations), per-id reads (read), and the simulation writers used by the workflow engine.Parameters#
- workspace
Project directory holding
catalog.duckdb(or a direct path to the.duckdbfile).- create
False(default) raisesFileNotFoundErrorwhen no catalog exists yet (no phantom catalog is created).Trueopens and initialises an empty catalog.
Returns#
- hydromodpy.results.catalog.SimulationCatalog
Catalog handle for the project.
Raises#
- FileNotFoundError
If no
catalog.duckdbis found andcreateisFalse.- hydromodpy.core.exceptions.CatalogError
If the DuckDB catalog file is locked, corrupted, or unreadable.
Examples#
>>> import hydromodpy as hmp >>> cat = hmp.open("~/ws/projects/naizin") >>> cat.latest()
See Also#
- hydromodpy.index
Machine-wide federation across registered workspaces.