Refactor sud JSON pot params under a nested 'pot' key
Top-level pot_mass/pot_material/L/Td/grain_mass/water_mass and their per-step overrides are now grouped under a 'pot' sub-object, matching the structure already applied to sud_0010.json's parent level. Updated all sude/*.json files and the parsing/consuming code in components/sud.py, tasks/sud.py, components/sud_forecast.py, and scripts/demos/sud/demo_sud.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T52JH848ojhXXHn1bAzdC3
This commit is contained in:
@@ -42,7 +42,8 @@ if __name__ == '__main__':
|
||||
sud.load(json.load(f))
|
||||
|
||||
first_step = sud.schedule[0]
|
||||
plant_params = sud.derive_plant_params(first_step['grain_mass'], first_step['water_mass'])
|
||||
first_pot = first_step.get('pot', {})
|
||||
plant_params = sud.derive_plant_params(first_pot.get('grain_mass', 0), first_pot.get('water_mass', 0))
|
||||
|
||||
ctrl = TempController(dt)
|
||||
ctrl.set_params(ctrl_params)
|
||||
@@ -74,7 +75,8 @@ if __name__ == '__main__':
|
||||
stirrer.set_speed(speed)
|
||||
|
||||
def apply_plant_params(step):
|
||||
params = sud.derive_plant_params(step['grain_mass'], step['water_mass'])
|
||||
pot = step.get('pot', {})
|
||||
params = sud.derive_plant_params(pot.get('grain_mass', 0), pot.get('water_mass', 0))
|
||||
plant.set_plant_params(params)
|
||||
ctrl.set_model_plant_params(params)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user