scandeval.types
source module scandeval.types
Types used throughout the project.
Classes
-
ComputeMetricsFunction — A function used to compute the metrics.
-
ExtractLabelsFunction — A function used to extract the labels from the generated output.
Functions
-
is_list_of_int — Check if an object is a list of integers.
-
is_list_of_list_of_int — Check if an object is a list of list of integers.
-
is_list_of_str — Check if an object is a list of integers.
source class ComputeMetricsFunction()
Bases : t.Protocol
A function used to compute the metrics.
source class ExtractLabelsFunction()
Bases : t.Protocol
A function used to extract the labels from the generated output.
source is_list_of_int(x: t.Any) → t.TypeGuard[list[int]]
Check if an object is a list of integers.
Parameters
-
x : t.Any —
The object to check.
Returns
-
t.TypeGuard[list[int]] — Whether the object is a list of integers.
source is_list_of_list_of_int(x: t.Any) → t.TypeGuard[list[list[int]]]
Check if an object is a list of list of integers.
Parameters
-
x : t.Any —
The object to check.
Returns
-
t.TypeGuard[list[list[int]]] — Whether the object is a list of list of integers.
source is_list_of_str(x: t.Any) → t.TypeGuard[list[str]]
Check if an object is a list of integers.
Parameters
-
x : t.Any —
The object to check.
Returns
-
t.TypeGuard[list[str]] — Whether the object is a list of strings.