mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-07 06:27:42 +00:00
8 lines
287 B
Python
8 lines
287 B
Python
"""Validation shared by direct native generation paths."""
|
|
import math
|
|
|
|
|
|
def validate_temperature(value):
|
|
if type(value) not in (int, float) or not math.isfinite(value) or value < 0:
|
|
raise ValueError('temperature must be a finite nonnegative number')
|
|
return float(value)
|