Validate.n

Validate.n(i=None, scalar=False)

Provides a dictionary of the number of test units for each validation step.

The n() method provides the number of test units for each validation step. This is the total number of test units that were evaluated in the validation step. It is always an integer value.

Test units are the atomic units of the validation process. Different validations can have different numbers of test units. For example, a validation that checks for the presence of a column in a table will have a single test unit. A validation that checks for the presence of a value in a column will have as many test units as there are rows in the table.

The method provides a dictionary of the number of test units for each validation step. If the scalar=True argument is provided and i= is a scalar, the value is returned as a scalar instead of a dictionary. The total number of test units for a validation step is the sum of the number of passing and failing test units (i.e., n = n_passed + n_failed).

Parameters

i : int | list[int] | None = None

The validation step number(s) from which the number of test units is obtained. Can be provided as a list of integers or a single integer. If None, all steps are included.

scalar : bool = False

If True and i= is a scalar, return the value as a scalar instead of a dictionary.

Returns

: dict[int, int] | int

A dictionary of the number of test units for each validation step or a scalar value.