Pot: require plant params and ambient temperature via setters, not the constructor
Pot.__init__ now only takes dt; set_plant_params() and set_ambient_temperature() must be called before process(), which now raises RuntimeError if either is missing instead of silently computing on whatever the constructor happened to default to. set_ambient_temperature() only seeds the plant's starting temperature the first time it's called, so changing ambient mid-run still can't clobber an in-progress simulated temperature. Updates all callers (server/brewpi.py, TempController(Smith)'s two internal models, SudForecastEstimator, and the plant/pid/sud demo scripts) to call the setters right after construction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DkkuG48uHFCGKe6dPSERFk
This commit is contained in:
@@ -45,7 +45,9 @@ if __name__ == '__main__':
|
||||
heatrate_soll = 1.25
|
||||
ctrl = TempController(dt, ctrl_params)
|
||||
ctrl.set_enabled(True)
|
||||
plant = Pot(dt, plant_params, theta_amb)
|
||||
plant = Pot(dt)
|
||||
plant.set_plant_params(plant_params)
|
||||
plant.set_ambient_temperature(theta_amb)
|
||||
_y = np.empty(0)
|
||||
_fb = np.empty(0)
|
||||
_t = np.empty(0)
|
||||
|
||||
Reference in New Issue
Block a user