Skip to content

validation

ValidationCheckpointer

Bases: Checkpointer

Checkpointer which can be used to validate the output of a test.

__init__(savepoint_data_path, thresholds, rank)

Parameters:

Name Type Description Default
savepoint_data_path str

path to directory containing netcdf savepoint data

required
thresholds SavepointThresholds

thresholds to check against

required
rank int

rank of the process, needed to compare against the correct savepoint data

required

trial()

Context manager for a trial.

When entered, resets reference data comparison back to the start of the data.

A new context manager should entered before the code being tested is called, and exited at the end of code execution.

__call__(savepoint_name, **kwargs)

Checks the arrays passed as keyword arguments against thresholds specified.

Parameters:

Name Type Description Default
savepoint_name str

name of the savepoint

required
**kwargs ArrayLike

array data for variables in that savepoint

{}

Raises:

Type Description
AssertionError

if the thresholds on any variable are not met