(threshold, condition_type="<")
| 14 | |
| 15 | |
| 16 | def _threshold_condition_function(threshold, condition_type="<"): |
| 17 | conditions = { |
| 18 | "<": lambda x: x < threshold, |
| 19 | "<=": lambda x: x <= threshold, |
| 20 | ">": lambda x: x > threshold, |
| 21 | ">=": lambda x: x >= threshold, |
| 22 | "==": lambda x: x == threshold, |
| 23 | } |
| 24 | assert condition_type in conditions, ( |
| 25 | f"condition_type {condition_type!r} is not supported" |
| 26 | ) |
| 27 | return conditions[condition_type] |
| 28 | |
| 29 | |
| 30 | # ── NaN statistics ──────────────────────────────────────────────────────────── |
no outgoing calls
no test coverage detected