hmp.open#
Open a workspace catalog backed by catalog.duckdb. With the default
create=False it raises FileNotFoundError when no catalog.duckdb
exists; pass create=True to initialise an empty catalog.
Signature#
hmp.open(workspace_path, *, create=False) -> SimulationCatalog
Reference#
- 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.
Example#
See Also#
hydromodpy.read()– read a variable from a run returned by the catalog.hydromodpy.results– catalog and run result implementations.