openclean.function.value.threshold module

Boolean functions that represent threshold predicates. Threshold predicates compare a given value against a threshold value using a comparison operator (on of <, <=, >, >=).

class openclean.function.value.threshold.GreaterOrEqual(threshold: float)

Bases: openclean.function.value.threshold.ThresholdPredicate

Greater than or equal threshold predicate (value >= threshold).

class openclean.function.value.threshold.GreaterThan(threshold: float)

Bases: openclean.function.value.threshold.ThresholdPredicate

Lower than threshold predicate (value > threshold).

class openclean.function.value.threshold.LowerOrEqual(threshold: float)

Bases: openclean.function.value.threshold.ThresholdPredicate

Lower than or equal threshold predicate (value <= threshold).

class openclean.function.value.threshold.LowerThan(threshold: float)

Bases: openclean.function.value.threshold.ThresholdPredicate

Lower than threshold predicate (value < threshold).

class openclean.function.value.threshold.ThresholdPredicate(threshold: float, op: Callable)

Bases: openclean.function.value.base.PreparedFunction

Base class for threshold constraints. This is a wrapper that maintains the threshold value and the comparison operator.

eval(value: Union[int, float, str, datetime.datetime, Tuple[Union[int, float, str, datetime.datetime]]]) bool

Evaluate the threshold predicate on a given value.

Parameters

value (scalar or tuple) – Value that is comared against the treshold.

Return type

bool