Fix Sud cooldown detection crashing the websocket on a real run

get_theta_ist() can return numpy.float64 (Pot's transport delay line
is a numpy array internally), so the cooldown comparison produced a
numpy.bool_ instead of a plain bool. json.dumps() can't serialize that,
which silently killed the websocket connection's send loop the moment
a ramp step started - found by actually driving the feature through a
live server+GUI run instead of only unit-style tests with a directly
constructed controller.
This commit is contained in:
2026-06-21 09:29:46 +02:00
parent 1170718c3b
commit 3a19e2a9dc
+4 -1
View File
@@ -66,7 +66,10 @@ class SudTask(ATask):
# its whole duration (decided once, here, rather than re-checked
# every tick) instead of relying on the controller's own FSM to
# notice and idle out.
cooling = ramping and ramp is not None and ramp['temp'] < self.tc.get_theta_ist() - TEMP_REACHED_TOLERANCE
# bool(...): get_theta_ist() can be a numpy.float64 (Pot's transport
# delay line is a numpy array internally) - the '<' comparison would
# then yield numpy.bool_, which json.dumps() can't serialize.
cooling = bool(ramping and ramp is not None and ramp['temp'] < self.tc.get_theta_ist() - TEMP_REACHED_TOLERANCE)
self.tc.set_cooling(cooling)
if step is not None: