mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 15:02:20 +02:00
9 lines
287 B
Python
9 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)
|