hmp.compare()#

compare(refs, *, variables=None, out=None, by='run', workspace=None)[source]#

Compare sealed runs, the first one as the reference.

A reference is a run directory, a run name or a recipe of the project (its latest run of each case), or the run. Comparison.table sets the parameters and the metrics of the runs side by side.

Parameters:
  • refs (Sequence[Ref]) – The runs to compare, the reference first.

  • variables (Sequence[str] | None) – The variables to compare. None takes those the runs share.

  • out (PathLike | None) – Write the comparison to this folder.

  • by (Literal['run', 'site']) – "site" compares the runs of each site the references hold and joins their scores; it needs out and returns the folder written.

  • workspace (PathLike | None) – The project directory, or a folder inside it.

Returns:

Comparison or pathlib.Path – The comparison, or the folder written with by="site".

Raises:
  • hydromodpy.project.compare.ComparisonReferenceError – If a reference names no sealed run.

  • hydromodpy.project.compare.ComparisonCaseError – If the runs cannot be compared.

Return type:

Comparison | Path