[display] DisplayConfig#

TOML section: [display]

Pydantic model: DisplayConfig defined in hydromodpy.display.config.

Source on GitHub

Display behaviour resolved from the [display] TOML section.

Show fields:

Fields#

enabled

bool default = True user source

Master switch. When False, no figure is rendered or saved.

backend

str default = “auto” dev source

Matplotlib backend. ‘auto’ selects Agg in headless mode and a GUI backend when show is enabled.

One of: "agg" "qt5agg" "auto"

preset

str default = “default” user source

Named theme applied before rendering any figure.

"default"

Uses a colorful sans-serif palette on a white background, for screen viewing.

"print"

Uses a grayscale serif palette sized for black-and-white print output.

"dark"

Uses a bright palette on a dark background, for dark-themed displays.

show

bool default = False user source

Open an interactive window via matplotlib.pyplot.show.

save

bool default = True user source

Write rendered figures to disk under output_dir.

output_dir

str default = “figures” user source

Name of the figures directory inside the run directory (<project>/runs/<run>/<output_dir>/). Declared as a name, not a path, so it stays anchored to the run it describes.

dpi

int default = 150 dev source

DPI used when saving raster figures.

cmap

str default = “viridis” user source

Force ONE colormap onto every spatial figure. Writing it at all is the decision, not the value: each figure otherwise picks a scale suited to what it shows, reversed for a depth, diverging for a difference, discrete for an indicator, and this replaces all of them. Writing the default spelled out is therefore NOT a no-op, unlike everywhere else. Leave it out unless one scale for everything is what you want.

figures

list[str] factory user source

Names of registered figures to auto-render at the end of hmp run (and consumed by hmp viz gallery). Every name must exist in the figure registry; list them with hmp viz list. A figure whose requirements the run does not meet is skipped with an explicit reason. Empty list disables auto-rendering. Disable per-run via hmp run –no-display or for an entire Python Project via Project(…, no_display=True).

on_error

str default = “warn” user source

Behaviour when a figure that IS applicable fails while rendering. ‘warn’ logs and continues (default, keeps a long run alive); ‘raise’ propagates, which is what example and CI configs want so a broken figure cannot pass unnoticed.

One of: "warn" "raise"

overrides in TOML: [display.overrides.<id>]

dict[str, dict] factory expert source

Per-figure keyword overrides, keyed by figure name (e.g. {'piezometric_map': {'cmap': 'cividis', 'vmin': 0}}).

Starter TOML snippet#

Click to expand a copy-pasteable [display] TOML skeleton

Copy this block into your project.toml and uncomment the lines you want to set. Sub-tables ([parent.subfield]) appear in the order Pydantic expects them.

[display]
# enabled = true
# preset = "default"
# show = false
# save = true
# output_dir = "figures"
# cmap = "viridis"
# figures = ...  # uses factory default
# on_error = "warn"

Entity-relationship diagram#

ER diagram for DisplayConfig

Click to zoom and pan. Press Esc or click outside to close.