BaseFigure#

class hydromodpy.display.BaseFigure[source]#

Bases: ABC

ABC providing the universal plot() boilerplate.

unavailable_reason(sim)[source]#

Return why this figure cannot render sim, or None when it can.

Checks the declared spec requirements against what the run actually persisted. This is what lets a project list every figure it may want and get only the ones its solver and processes produced: a run without particle tracking reports particle_tracks as unavailable rather than drawing an empty axes.

Parameters:

sim (Run)

Return type:

str | None

static field_descriptor_for(variable)[source]#

Return the canonical descriptor for variable.

Helper for figures that need long_name / units to label axes or colorbars without hard-coding strings. Raises UnknownFieldError if variable is not registered.

Parameters:

variable (str)

Return type:

FieldDescriptor

static axis_label_for(variable)[source]#

Return "<long_name> (<units>)" for variable from the registry.

Parameters:

variable (str)

Return type:

str