dataeval.config.resolve_batch_size

dataeval.config.resolve_batch_size(*candidates)

Resolve a batch size from an ordered list of candidates.

Returns the first non-None candidate (validated > 0). If every candidate is None, falls back to the global batch size via get_batch_size(), which raises if no global is set. Precedence is caller order: the earliest non-None candidate wins (outer/override before inner/default).

Parameters:
*candidates : int or None

Candidate batch sizes in priority order (highest priority first).

Returns:

The resolved batch size.

Return type:

int

Raises:
  • ValueError – If no candidate is non-None and no global batch size is set.

  • ValueError – If a non-None candidate is less than 1.