FigureSpec#

class hydromodpy.display.FigureSpec(name, title, former_names=(), kind='spatial', required_fields=(), optional_fields=(), required_tables=(), required_solvers=(), default_figsize=(7.0, 5.0))[source]#

Bases: object

Static metadata describing one figure type.

required_fields lists Zarr fields the figure reads (e.g. "head"). required_tables lists DuckDB tables (e.g. "timeseries"). required_solvers restricts the figure to specific solver backends (empty means any). Together they define whether one figure applies to a given run: BaseFigure.unavailable_reason() turns them into a human-readable reason, so a figure that does not fit the configured processes is skipped explicitly instead of failing at render time.

optional_fields lists fields the figure reads when they are there and does without otherwise. Required means “cannot render without”; optional means “compute it when this figure is asked for, but refuse with a sentence rather than be reported unavailable”. A categorical map over a family of packages needs the family computed, not every member of it, so it declares the family here and its own unavailable_reason decides what a run missing all of them is told.

Parameters:
former_names: tuple[str, ...]#

What this figure used to be called.

A figure name is written in [display].figures and checked against the registry, so a rename refuses every project file that already lists it. Declaring the old spelling here keeps those files loading and warns with both names, which is the only way a reader learns what to write.