Commit 887016e2 authored by Brewer, Wes's avatar Brewer, Wes
Browse files

Fix crash when FMU lacks centralEnergyPlant (e.g. lassen)



Guard CEP data extraction with a key check so systems whose FMU
does not output a centralEnergyPlant component can still run with
cooling enabled, producing CDU data but an empty CEP list.

Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent e24f4943
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ def run_simulation(sim_config: ServerSimConfig):
                    "facility_flowrate": cdu_data['V_flow_prim_GPM'],
                }

            if 'centralEnergyPlant' in fmu_data['simulator'][1]:
                cep_data = fmu_data['simulator'][1]['centralEnergyPlant'][1]
                cooling_sim_cep = [CoolingSimCEP.model_validate({
                "timestamp": timestamp,