Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
418 commits
Select commit Hold shift + click to select a range
87580a3
Extract calcAuxElecPower and setMergedSpeedVars helpers to deduplicat…
lefticus Mar 20, 2026
218fc46
Consolidate four energy-rate reporting branches into two in reportUni…
lefticus Mar 20, 2026
904fd77
Extract isPackagedUnit() method to replace repeated three-way sysType…
lefticus Mar 20, 2026
73da00e
Consolidate four identical SimVariableSpeedCoils calls in simMultiSpe…
lefticus Mar 20, 2026
a503554
Update auto-dry-refactor agent to keep track of updated functions
lefticus Mar 21, 2026
6d1cdf7
Extract readFluidCtrlCommonFields to deduplicate FluidTCtrl HP and HR…
lefticus Mar 21, 2026
786bdfe
Extract helper lambdas to deduplicate multi-speed flow array init and…
lefticus Mar 21, 2026
2cf3a41
Extract WaterToAir coil dispatch tables to deduplicate 12 repetitive …
lefticus Mar 21, 2026
324d4de
Fix unused parameter warning in readWaterToAirCoil lambda in GetFurna…
lefticus Mar 21, 2026
0fed95d
DRY refactor VRF/SurfaceGeometry, add viz dashboard, harden agent pro…
lefticus Mar 21, 2026
8252334
DRY refactor SetupReportInput: consolidate duplicate CoilFlag/non-Coi…
lefticus Mar 21, 2026
4b5f1d3
Extract helper lambdas to deduplicate SpectralAndAngle curve validati…
lefticus Mar 21, 2026
e1c71e1
Extract calcZoneVentEfficiency helper to deduplicate VRP/SP ventilati…
lefticus Mar 21, 2026
267453c
Extract updateMinADEffBySys helper to deduplicate zone AD efficiency …
lefticus Mar 21, 2026
25aea38
Extract copyCoolPeakToCalcSysSizing helper to deduplicate cooling pea…
lefticus Mar 21, 2026
8b63154
Extract saveDuringDayCoolPeak helper to deduplicate cooling peak save…
lefticus Mar 21, 2026
4aa32cc
Add UpdateSysSizing to dry-refactor-done list
lefticus Mar 21, 2026
f3c1356
Extract checkCurveInputLimits helper to deduplicate 29 input-limit va…
lefticus Mar 21, 2026
a8b64b7
Extract readOptionalOutputLimits helper to deduplicate 20 output-limi…
lefticus Mar 21, 2026
c80b51b
DRY refactor GetCurveInputData: extract checkCurveUnitTypes and readO…
lefticus Mar 21, 2026
947a235
DRY refactor GetCurveInputData: extract readCurveObject helper, repla…
lefticus Mar 21, 2026
82dfe07
Extract readCurveObject helper to deduplicate 20 getObjectItem+duplic…
lefticus Mar 21, 2026
5432237
Add GetCurveInputData to dry-refactor-done list
lefticus Mar 21, 2026
981fcec
DRY refactor GetCurveInputData: extract readSimpleCurveFields helper …
lefticus Mar 21, 2026
f2b4a0d
DRY refactor InitVRF: extract warnAndCapFlowRate helper to deduplicat…
lefticus Mar 21, 2026
45e0dbf
DRY refactor InitVRF: extract calcVRFCoilOff helper to deduplicate 6 …
lefticus Mar 21, 2026
678052a
Extract sizeOutdoorAirFlow helper to deduplicate 3 OA flow sizing blo…
lefticus Mar 21, 2026
d942243
Extract setCoolingCapCurveIndex helper to deduplicate cooling coil cu…
lefticus Mar 21, 2026
01169a3
Consolidate duplicate cooling/heating air flow sizing blocks in sizeS…
lefticus Mar 21, 2026
24526dc
DRY refactor InitVRF: extract warnOATLimitExceeded helper to deduplic…
lefticus Mar 21, 2026
4f3c933
Promote sizeSystem helper lambdas to static free functions
lefticus Mar 21, 2026
4a1aea4
DRY refactor InitVRF: extract warnAndResetDOASOutdoorAirFlow helper t…
lefticus Mar 21, 2026
fb0a8d6
Add InitVRF to dry-refactor-done.txt
lefticus Mar 21, 2026
1f8bff0
Extract readFaultSchedules helper to deduplicate avail/severity sched…
lefticus Mar 21, 2026
0345e2c
Extract validateRequiredAlphaField helper to deduplicate blank-field …
lefticus Mar 21, 2026
d919540
Extract showFaultEquipNotFoundError helper to deduplicate equipment l…
lefticus Mar 21, 2026
81bb2c2
Extract showChillerNotWaterCooledWarning helper to deduplicate chille…
lefticus Mar 21, 2026
6498e1f
Add FaultsManager::CheckAndReadFaults to dry-refactor done list
lefticus Mar 21, 2026
3eb2db9
Extract setupEquipObjectOutputs to deduplicate per-object output vari…
lefticus Mar 21, 2026
51e39f2
Extract dispatchEquipZoneSpaceOutputs to consolidate zone/space outpu…
lefticus Mar 21, 2026
1769ff0
Extract setupBaseboardZoneSpaceOutputs to deduplicate zone/space base…
lefticus Mar 21, 2026
0a33a2b
Extract setupOtherEquipZoneSpaceOutputs to deduplicate Other Equipmen…
lefticus Mar 21, 2026
73ac094
Add setupIHGOutputs to dry-refactor done list
lefticus Mar 21, 2026
d052ed5
DRY refactor WriteBEPSTable: extract writeBEPSSubtable helper to dedu…
lefticus Mar 21, 2026
3d8eebc
DRY refactor WriteBEPSTable: extract accumulateSourceEnergy helper to…
lefticus Mar 21, 2026
739183c
DRY refactor WriteBEPSTable: replace 4 repeated resource index mappin…
lefticus Mar 21, 2026
bf81e2e
DRY refactor WriteBEPSTable: extract fillSourceConversionCell helper …
lefticus Mar 21, 2026
a924fbe
Extract reportSizingComparison helper to deduplicate 5 hardsize-vs-au…
lefticus Mar 21, 2026
b2d478a
Extract getPlantSizingIndexAndRatioTS helper to deduplicate 6 plant s…
lefticus Mar 21, 2026
29fbcdb
Replace ~30 inline format() calls with existing CompType variable in …
lefticus Mar 21, 2026
b97e6ff
Extract showCapacitySizingStats helper to deduplicate warning blocks …
lefticus Mar 21, 2026
df78ab8
Add SizeHVACWaterToAir to dry-refactor done list
lefticus Mar 21, 2026
3502262
Extract loadSetptSchedObjects helper to deduplicate 8 setpoint schedu…
lefticus Mar 21, 2026
661389a
Extract showMissingSetptSchedError to deduplicate schedule validation…
lefticus Mar 21, 2026
91f668b
Extract applyOpTempCtrlToZone to deduplicate operative temperature co…
lefticus Mar 21, 2026
91fd653
Add GetZoneAirSetPoints to dry-refactor-done.txt
lefticus Mar 21, 2026
2334aa7
Extract connectAirTermToZone helper to deduplicate ADU lookup and zon…
lefticus Mar 21, 2026
0933bed
Extract getAndValidateCurve helper to deduplicate 41 curve-lookup blo…
lefticus Mar 21, 2026
0c8eb71
Extract parseReheatCoilTypeAndIndex helper to deduplicate reheat coil…
lefticus Mar 21, 2026
f43cde5
Extract lookupReheatControlNode helper to deduplicate steam/water con…
lefticus Mar 21, 2026
a55f7f9
Consolidate 7 repeated getObjectDefMaxArgs calls into a loop in Singl…
lefticus Mar 21, 2026
854e4e0
Add SingleDuct::GetSysInput to dry-refactor-done.txt
lefticus Mar 21, 2026
25991f3
Extract parseModeAvailability helper to deduplicate 5 Yes/No mode-ava…
lefticus Mar 21, 2026
f58ea35
Extract accumulateHeatZoneFlowsDuringDay to deduplicate DuringDay hea…
lefticus Mar 21, 2026
b7a12bd
Add GetTESCoilInput to dry-refactor-done.txt
lefticus Mar 21, 2026
92bead8
Extract computeHeatRetMixCap to deduplicate DuringDay heating return/…
lefticus Mar 21, 2026
65450fd
Extract saveDuringDayHeatPeak to deduplicate DuringDay heating peak s…
lefticus Mar 21, 2026
a6ef362
Extract accumulateNonCoinHeatZoneData to deduplicate EndSysSizingCalc…
lefticus Mar 21, 2026
c70fb0d
DRY refactor AllocateModuleArrays: extract setupBlindOutputVars to de…
lefticus Mar 21, 2026
174d990
DRY refactor AllocateModuleArrays: extract setupScreenOutputVars to d…
lefticus Mar 21, 2026
ee19195
DRY refactor AllocateModuleArrays: extract setupFrameDividerOutputVar…
lefticus Mar 21, 2026
1168f7b
DRY refactor UpdateSysSizing: extract updateCoolVRPEvzVot to deduplic…
lefticus Mar 21, 2026
1d522ca
DRY refactor AllocateModuleArrays: extract setupWindowGlazingOutputVa…
lefticus Mar 21, 2026
28dd15b
Add AllocateModuleArrays to dry-refactor-done.txt
lefticus Mar 21, 2026
33a5465
DRY refactor UpdateSysSizing: extract updateHeatVRPVot to deduplicate…
lefticus Mar 21, 2026
e4932e3
DRY refactor UpdateSysSizing: extract updateZoneSumVolFlows to dedupl…
lefticus Mar 21, 2026
65a431b
DRY refactor UpdateSysSizing: extract getInducRatTempFrac to deduplic…
lefticus Mar 21, 2026
67f6acf
Extract simHXAssistedCooling helper to deduplicate 7 SimHXAssistedCoo…
lefticus Mar 21, 2026
e31b51f
Extract solveForVarSpeedRatio/solveForCyclingRatio helpers to dedupli…
lefticus Mar 21, 2026
5fbc636
DRY refactor GetTowerInput: extract 4 helpers to deduplicate common t…
lefticus Mar 21, 2026
da9a75d
Extract solveForVarSpeedHumRat/solveForCyclingHumRat helpers to dedup…
lefticus Mar 21, 2026
2c27b29
Add controlCoolingSystemToSP to dry-refactor-done.txt
lefticus Mar 21, 2026
5edf128
Extract parseDesignConditions helper to deduplicate design inlet/outl…
lefticus Mar 21, 2026
f1378e9
Extract parseWaterNodes helper to deduplicate water inlet/outlet node…
lefticus Mar 21, 2026
2ddae05
DRY refactor SolarShading: extract getScreenBtar helper to deduplicat…
lefticus Mar 21, 2026
2f64f31
DRY refactor ProcessScheduleInput: extract ExternalInterface schedule…
lefticus Mar 21, 2026
d6d6838
DRY refactor ProcessScheduleInput: table-driven object counting and m…
lefticus Mar 21, 2026
3a1cf92
DRY refactor ProcessScheduleInput: extract validateScheduleType helper
lefticus Mar 21, 2026
e2a6a79
DRY refactor ProcessScheduleInput: extract day-schedule value warning…
lefticus Mar 21, 2026
58adfe3
Add ProcessScheduleInput to dry-refactor-done.txt
lefticus Mar 21, 2026
4bf9792
Extract checkRadiantSurfaceAssignment helper to deduplicate 3 identic…
lefticus Mar 21, 2026
df07c05
Extract parseDesignCapacitySizingMethod to deduplicate heating/coolin…
lefticus Mar 21, 2026
7b80d77
Extract parseSurfaceListOrSingleSurface to deduplicate 3 surface-list…
lefticus Mar 21, 2026
e3915e7
Extract applyDesignCapacityFromDesignObject to deduplicate heating/co…
lefticus Mar 21, 2026
536780f
Add GetLowTempRadiantSystem to dry-refactor-done.txt
lefticus Mar 21, 2026
359acd0
Consolidate secondary loop CoilFlag/non-CoilFlag duplicate SetupOutpu…
lefticus Mar 21, 2026
b480026
Extract setupCompressorOutputVars helper to deduplicate compressor ou…
lefticus Mar 21, 2026
de82032
Consolidate duplicate condenser fan electricity output variables for …
lefticus Mar 21, 2026
86c9b14
Consolidate NumStages==1/2 duplicate output variable blocks in SetupR…
lefticus Mar 21, 2026
67a85af
Add SetupReportInput to dry-refactor done list
lefticus Mar 21, 2026
eb5f7ba
Extract validateSpeedFlowRates helper to deduplicate heating/cooling …
lefticus Mar 21, 2026
eebd6d3
Remove dead duplicate code branch and simplify SetUpCompSets for Elec…
lefticus Mar 21, 2026
1a15867
Consolidate duplicate Electric/Gas MultiStage heating coil validation…
lefticus Mar 21, 2026
dddfc56
Add GetMSHeatPumpInput to dry-refactor done list
lefticus Mar 21, 2026
70ffdc8
Extract setupCommonHeatingCoilOutputVars to deduplicate output variab…
lefticus Mar 21, 2026
9afb1cc
Extract setupCoilAirNodes to deduplicate air node registration in Get…
lefticus Mar 21, 2026
001ffd1
Extract validateHeatReclaimEfficiency to deduplicate desuperheater he…
lefticus Mar 21, 2026
c00e357
Add HeatingCoils::GetHeatingCoilInput to dry-refactor done list
lefticus Mar 21, 2026
9ddcccc
Extract mineWaterHeatingCoilData and mineSteamHeatingCoilData helpers…
lefticus Mar 21, 2026
c6c021f
Extract lookupCurve lambda to deduplicate 8 performance curve lookups…
lefticus Mar 21, 2026
bc7cb89
Extract warnIfCoilHasSetpointNode lambda to deduplicate regen coil se…
lefticus Mar 21, 2026
f26a346
Add DesiccantDehumidifiers::GetDesiccantDehumidifierInput to dry-refa…
lefticus Mar 21, 2026
2a5b6bd
Extract makeLoadResidualFunc to deduplicate 5 identical lambda wrappe…
lefticus Mar 21, 2026
2ef5115
Extract warnPLROutOfRange to deduplicate 4 identical solver warning b…
lefticus Mar 21, 2026
c90ae71
Extract warnPLRMaxIterExceeded to deduplicate sensible and latent ite…
lefticus Mar 21, 2026
e4db4d0
Add controlUnitarySystemOutput to dry-refactor done list
lefticus Mar 21, 2026
55308ca
Extract validateMultispeedMonotonicity helper to deduplicate 6 speed-…
lefticus Mar 21, 2026
c5daf12
Consolidate duplicate capacity-stage branches in SizeDXCoil PreDefTab…
lefticus Mar 21, 2026
6a5e36e
Extract applySizeResultOrReport helper to deduplicate 4 autosize-or-r…
lefticus Mar 21, 2026
7db8748
Extract runAutoCalcSizer helper to deduplicate 7 AutoCalculateSizer+i…
lefticus Mar 21, 2026
edd7bd4
Add SizeDXCoil to dry-refactor-done.txt
lefticus Mar 21, 2026
67a38ec
Extract printEquipEioRow helper to deduplicate 5 equipment EIO report…
lefticus Mar 21, 2026
0dc9861
Extract printEioScheduleMinMax to deduplicate day-type schedule EIO p…
lefticus Mar 21, 2026
0570d32
Extract getITECurve lambda to deduplicate 5 ITE curve validation bloc…
lefticus Mar 21, 2026
2fb01b9
Extract readAndValidateCO2RateFactor lambda to deduplicate CO2 rate v…
lefticus Mar 21, 2026
759a990
Extract simulateCoolingCoilOff helper to deduplicate cooling-coil-off…
lefticus Mar 21, 2026
3c66579
Extract findMultiModeDXCoilPLR helper to deduplicate DX MultiMode coi…
lefticus Mar 21, 2026
016cb2d
Extract copyHeatPeakToCalcSysSizing helper to deduplicate heat peak f…
lefticus Mar 21, 2026
3086898
Fix unused-function warning for copyHeatPeakToCalcSysSizing in SimAir…
lefticus Mar 21, 2026
1ef1790
Extract reportDXCoilPLRSolverError helper to deduplicate SolveRoot er…
lefticus Mar 21, 2026
fd24258
Add CalcCBVAV to dry-refactor done list
lefticus Mar 21, 2026
a1560be
Extract sizeMultispeedFanFlowRates helper to deduplicate 4 multispeed…
lefticus Mar 21, 2026
7d047ca
Extract reportSizingMismatchWarning helper to deduplicate 6 sizing wa…
lefticus Mar 21, 2026
b271249
Consolidate duplicate cooling/heating designSpecMSHP speed loops in S…
lefticus Mar 21, 2026
4b37a58
Extract reportVRFCondFieldSize helper to deduplicate 5 condenser-leve…
lefticus Mar 21, 2026
5aed6cb
Add SizeVarSpeedCoil to dry-refactor-done.txt
lefticus Mar 21, 2026
d6e2c6a
Extract calcVRFPipingCorrectionFactor helper to deduplicate cooling/h…
lefticus Mar 21, 2026
e88e048
Reuse reportVRFCondFieldSize helper for 3 TU-level outdoor air flow a…
lefticus Mar 21, 2026
6603777
Extract warnVRFSizingMismatch helper to deduplicate FluidTCtrl sizing…
lefticus Mar 21, 2026
ec2cb26
Add SizeVRF to dry-refactor-done.txt
lefticus Mar 21, 2026
de57536
Extract checkMixingTempLimits helper to deduplicate temperature limit…
lefticus Mar 21, 2026
574a039
Consolidate three-way TD branching in CalcAirFlowSimple Mixing loop
lefticus Mar 21, 2026
9158a4c
Extract zeroMixingHeatBalanceFields to deduplicate zone/space heat ba…
lefticus Mar 21, 2026
be8b0ed
DRY refactor CalcOptStartSysAvailMgr: extract findFanStartTime helper…
lefticus Mar 21, 2026
10a50a4
Extract calcInfVentAirDensity to deduplicate density-basis switch in …
lefticus Mar 21, 2026
130aa68
Add CalcAirFlowSimple to dry-refactor-done.txt
lefticus Mar 21, 2026
0fef00b
DRY refactor CalcOptStartSysAvailMgr: extract calcPreStartTimes helpe…
lefticus Mar 21, 2026
5457c00
DRY refactor CalcOptStartSysAvailMgr: extract updateAdaptiveTempGrad …
lefticus Mar 21, 2026
4a6e09d
DRY refactor CalcOptStartSysAvailMgr: extract updateAdaptiveTempGradH…
lefticus Mar 21, 2026
e64489f
Add CalcOptStartSysAvailMgr to dry-refactor-done list
lefticus Mar 21, 2026
ef20ec9
Extract adjustVRFOvershootFlowAndLoad helper to deduplicate 5 oversho…
lefticus Mar 21, 2026
b03ee8c
Extract setVRFCompFlowsCooling/Heating helpers to deduplicate 14 flow…
lefticus Mar 21, 2026
c721a50
DRY refactor GetPumpInput: extract parsePumpZoneSkinLosses helper to …
lefticus Mar 21, 2026
bc4e8e9
Extract solveFurnaceResidual helper to deduplicate 6 lambda+SolveRoot…
lefticus Mar 21, 2026
a6bb55f
DRY refactor GetPumpInput: extract parsePumpPowerSizing helper to ded…
lefticus Mar 21, 2026
c6aff06
Introduce isHP boolean to replace repeated heat-pump type checks in C…
lefticus Mar 21, 2026
42bc26f
DRY refactor GetPumpInput: replace SetupZoneInternalGain switch with …
lefticus Mar 21, 2026
7e5bbdb
Add CalcNewZoneHeatCoolFlowRates to dry-refactor done list
lefticus Mar 21, 2026
4ce45c0
DRY refactor GetPumpInput: extract parsePumpPressureCurve helper to d…
lefticus Mar 21, 2026
3e9f79a
Add GetPumpInput to dry-refactor-done list
lefticus Mar 21, 2026
bea1d07
Extract reportSizerPair/reportSizerByType helpers to deduplicate sizi…
lefticus Mar 21, 2026
3e64fe6
Extract reportUASolverFailure helper to deduplicate UA solver error d…
lefticus Mar 21, 2026
038f9d2
Extract solveForUA helper to deduplicate UA solver lambda/SolveRoot/e…
lefticus Mar 21, 2026
5b0ebfe
Add SizeEvapFluidCooler to dry-refactor-done.txt
lefticus Mar 21, 2026
c05999d
DRY refactor GetVentilatedSlabInput: merge identical SlabOnly and Ser…
lefticus Mar 22, 2026
3a46d46
Fix segfault in sizeSystem: guard FinalZoneSizing access in sizeOutdo…
lefticus Mar 22, 2026
510dd79
Update rules for auto-dry-refactor
lefticus Mar 22, 2026
e0a8c93
Fix 9 behavioral/output differences introduced by DRY refactoring
lefticus Mar 22, 2026
be58fd0
Fix regression diffs: ERR message format, output variable ordering
lefticus Mar 22, 2026
29d0bc9
Revert sizeSystem refactoring to fix table big diff regression
lefticus Mar 22, 2026
4b1afd4
Fix MSVC build: qualify ambiguous format() calls with EnergyPlus::
lefticus Mar 22, 2026
4de635b
Fix remaining MSVC format() ambiguity in InternalHeatGains.cc
lefticus Mar 22, 2026
485047f
Fix ambiguous call to format in refrigeratedcase (Windows)
lefticus Mar 22, 2026
ea8b5b7
Fix MSVC format() ambiguity in UnitarySystem and VariableSpeedCoils
lefticus Mar 22, 2026
54f5e47
One more Windows build fix
lefticus Mar 22, 2026
d238a1e
Apply proper formatting
lefticus Mar 23, 2026
29df663
Fix formatting
lefticus Mar 23, 2026
ed34d1e
Extract reportSizerOutputFinalAndInitial helper in CondenserLoopTowers
lefticus Mar 23, 2026
d9607bd
Extract getMaterialInput helper to deduplicate 21 identical getObject…
lefticus Mar 23, 2026
98176dd
Extract validation helpers to deduplicate sum-check and equality-chec…
lefticus Mar 23, 2026
c180300
Extract checkDupMaterialName and registerMaterial helpers in GetMater…
lefticus Mar 23, 2026
e609f6f
Extract findReferencedEpJSONObject helper to deduplicate epJSON looku…
lefticus Mar 23, 2026
76f68ab
Extract checkFieldPositive and checkFieldInRange01 helpers to dedupli…
lefticus Mar 23, 2026
52e06a9
Extract checkFieldPairSumNotExceedOne helper to deduplicate glazing s…
lefticus Mar 23, 2026
404d210
Replace inline EQL Blind sum-check blocks with checkFieldSumLessThan …
lefticus Mar 23, 2026
55e7407
Extract initDefaultGlycolProperty helper to deduplicate default glyco…
lefticus Mar 23, 2026
0d1cdba
Extract helpers for glycol raw property allocation and concentration …
lefticus Mar 23, 2026
459c93e
Extract registerGlycolRawConcPoint helper for glycol concentration co…
lefticus Mar 23, 2026
6ba4ae3
Consolidate 7 saturated property missing-data checks with a lambda
lefticus Mar 23, 2026
86d333c
Add GetFluidPropertiesData to dry-refactor done list
lefticus Mar 23, 2026
ad91661
Deduplicate OA flow rate sizing in UnitarySys::sizeSystem
lefticus Mar 23, 2026
c83121f
Extract ensureMultiSpeedArrays helper in UnitarySys::sizeSystem
lefticus Mar 23, 2026
bb55a17
Consolidate cooling/heating air flow sizing in sizeSystem
lefticus Mar 23, 2026
0c0598b
Extract MSHP vol-flow-ratio autosize and cooling flow helpers
lefticus Mar 23, 2026
63d3c94
Extract lookupReferenceConditions and addElementToLookup helpers in A…
lefticus Mar 23, 2026
9741b58
Use addElementToLookup helper across 14 call sites in AirflowNetwork …
lefticus Mar 23, 2026
34a39f8
Hoist shade material property extraction above IntShade/ExtShade/BGSh…
lefticus Mar 23, 2026
a69ff0a
Hoist between-glass diffuse property loading above BGShade/BGBlind br…
lefticus Mar 23, 2026
1cb4e0e
Hoist NGlass==3 diffuse property loading into shared BGFlag block
lefticus Mar 23, 2026
d1069bc
Extract convertGlassToBGSpectralAverage helper for BG shade/blind war…
lefticus Mar 23, 2026
8807c8c
Add InitGlassOpticalCalculations to dry-refactor done list
lefticus Mar 23, 2026
491a584
Extract calcIUEvapRefFlowAndSH helper in CalcVRFCondenser_FluidTCtrl
lefticus Mar 23, 2026
73b12e9
Extract calcIUCondRefFlowAndSC helper in CalcVRFCondenser_FluidTCtrl
lefticus Mar 23, 2026
060dc03
Add CalcVRFCondenser_FluidTCtrl to dry-refactor done list
lefticus Mar 23, 2026
d4f336d
Extract dxMultiSpeedHumRatControl helper in controlCoolingSystemToSP
lefticus Mar 23, 2026
33a988c
Add controlCoolingSystemToSP to dry-refactor done list
lefticus Mar 23, 2026
f92a4a9
Extract calcRatedTotalCoolCap helper in SizeHVACWaterToAir
lefticus Mar 23, 2026
0f09d78
Extract calcRatedSensCoolCap helper in SizeHVACWaterToAir
lefticus Mar 23, 2026
d516c43
Extract calcRatedHeatCap helper in SizeHVACWaterToAir
lefticus Mar 23, 2026
3264450
Add SizeHVACWaterToAir to dry-refactor done list
lefticus Mar 23, 2026
60c5368
Extract checkUniqueAirNode helper to deduplicate node uniqueness chec…
lefticus Mar 23, 2026
9115c38
Replace component-type if-else chain with static lookup map in GetAir…
lefticus Mar 23, 2026
006774e
Replace PackagedUnit if-else chain with static set lookup in GetAirPa…
lefticus Mar 23, 2026
8a4d426
Extract allocateControllerArrays helper to deduplicate controller arr…
lefticus Mar 23, 2026
3975d04
Add GetAirPathData to dry-refactor done list
lefticus Mar 23, 2026
d03a210
Extract reheat coil helpers in SingleDuct::GetSysInput
lefticus Mar 23, 2026
3fd5e4c
Extract accumulateBeginDayNonCoinHeatMassFlow helper in UpdateSysSizing
lefticus Mar 23, 2026
0138bbe
Extract scaleZoneHeatFlows helper in UpdateSysSizing EndSysSizingCalc
lefticus Mar 23, 2026
327ccba
Extract sumDesHeatVolFlow helper in UpdateSysSizing
lefticus Mar 23, 2026
f210cb7
Extract computeHeatVentEffAndVozSum helper in UpdateSysSizing EndDay
lefticus Mar 23, 2026
ead5ee6
Extract accumulateNonCoinCoolZoneData helper in UpdateSysSizing
lefticus Mar 23, 2026
f92aaaa
Extract applyCoolSizingRat helper in UpdateSysSizing
lefticus Mar 23, 2026
e89fa30
Extract applyHeatSizingRat helper in UpdateSysSizing
lefticus Mar 23, 2026
fa13d79
Extract writeSysSizingResults helper in UpdateSysSizing
lefticus Mar 23, 2026
c3ed55a
Extract checkOATLimitAndSwitchMode helper in InitVRF
lefticus Mar 23, 2026
e5471d7
Extract findMatchingZoneAirNode helper in InitVRF
lefticus Mar 23, 2026
984ac66
Extract setVRFTUNodeMassFlowRate helper in InitVRF
lefticus Mar 23, 2026
a773184
Extract initSingleGasMaterial lambda in GetMaterialData
lefticus Mar 23, 2026
03aa421
Extract readFieldAndValidateRange01 for screen opening multipliers
lefticus Mar 23, 2026
424a9cc
Convert validateSpecAngCurve lambda to static free function
lefticus Mar 23, 2026
37776c5
Convert loadCustomGasProps and calcGasNominalR to static functions
lefticus Mar 23, 2026
85463cc
Consolidate 18 simple curve input loops into data-driven table
lefticus Mar 23, 2026
cd7047e
Add QuadLinear and QuintLinear to simpleCurveSpecs data table
lefticus Mar 23, 2026
d497004
Extract checkSpeedLevelMonotonicity helper in SizeVarSpeedCoil
lefticus Mar 23, 2026
e771a8b
Extract warnSensibleExceedsTotal helper in SizeVarSpeedCoil
lefticus Mar 23, 2026
10bbfed
Extract calcHPWHCoolCapacity helper in SizeVarSpeedCoil
lefticus Mar 23, 2026
b760a9e
Extract classifySurfaceFilter helper to deduplicate SurfaceFilter lis…
lefticus Mar 23, 2026
d9623c5
Extract checkSubSurfaceExtBoundConsistency helper from GetSurfaceData
lefticus Mar 23, 2026
d6f9dda
Extract matchInterzoneSurfaces helper from GetSurfaceData
lefticus Mar 23, 2026
acd8085
Extract buildSurfaceLists helper from GetSurfaceData
lefticus Mar 23, 2026
5951ad1
Extract reportWaterFlowSolveRootErrors helper in Sim4PipeFanCoil
lefticus Mar 23, 2026
f0111ad
Extract reportPLRSolveRootErrors helper in Sim4PipeFanCoil
lefticus Mar 23, 2026
2d7c168
Extract iterateFanCoilPLR helper in Sim4PipeFanCoil
lefticus Mar 23, 2026
25a89ac
Extract calcFlowLockedBypass helper in Sim4PipeFanCoil
lefticus Mar 23, 2026
3a65fe2
Add Sim4PipeFanCoil to dry-refactor done list
lefticus Mar 23, 2026
49fb275
Fix pre-existing build errors in SurfaceGeometry and FanCoilUnits
lefticus Mar 23, 2026
41b6d06
Add analyzed functions to dry-refactor done list
lefticus Mar 23, 2026
8e6e2ab
Extract resetDXCoilSizingState helper in SizeDXCoil
lefticus Mar 23, 2026
d4d2338
Extract sizeMultispeedEvapCondField helper in SizeDXCoil
lefticus Mar 23, 2026
a7d6c7a
Extract validateTwoSpeedLowVsHigh helper in SizeDXCoil
lefticus Mar 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions .claude/agents/auto-dry-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
name: auto-dry-refactor
description: Find the largest un-refactored function in src/EnergyPlus, then do up to 4 rounds of DRY refactoring with compile/test/commit cycles.
tools: Read, Edit, Write, Bash, Glob, Grep
model: opus
---

# Auto DRY Refactoring Agent

You find the largest function that hasn't been refactored yet, then do up to 4 rounds of: refactor → build → test → commit.

## RULES

- **Do NOT install anything.** lizard, cmake, ctest, git are already installed.
- **Never change behavior.** Purely structural refactoring.
- **Skip rather than break.** 3 retries max per stage, then revert and skip.
- **Always verify.** Never commit without successful compile + tests.
- **Do NOT use `touch` to force recompilation.**
- **Prefer static free functions over lambdas** for extracted helpers (they reduce NLOC and show in stack traces). Lambdas only for ≤10 lines or complex captures.
- **Use what exists.** Grep for existing utilities before writing new helpers.

## Phase 1: Prepare

## Step 1: Pick a Function

Read `tools/dry-refactor-done.txt` (if it exists) — these are already processed.

Find all functions over 500 NLOC, sorted largest-first. The `-w` flag suppresses per-file noise and only prints warnings. lizard exits with code 1 when warnings exist — this is normal.

```bash
lizard src/EnergyPlus/ -L 500 -w -t8 --sort nloc 2>&1 || true
```
Each output line looks like: `<file>:<line>: warning: <qualified_name> has <NLOC> NLOC, ...`

Go through results largest-first. Skip any in the done list. For each candidate, read the function body and look for DRY opportunities (≥2 blocks of ≥10 duplicated lines). Pick the first one with opportunities.

If no candidates have DRY opportunities, report "No suitable candidates" and stop.

## Step 2: Refactor Loop (repeat up to 4 times)

1. Identify the source file and exact function boundaries (start/end lines).
2. Map the source file to its test file: `src/EnergyPlus/Foo.cc` → `tst/EnergyPlus/unit/Foo.unit.cc`
3. Derive a ctest filter substring from the filename for use with `-R "EnergyPlusFixture.*<substring>"`. For example, `RefrigeratedCase.cc` → `Refr`.
4. Analyze the function for DRY violations:
- Repeated code blocks (exact or near-exact duplicates)
- Copy-paste patterns with minor variations (e.g., same logic applied to different variables)
- Common setup/teardown sequences that could be extracted into helpers
- Repeated conditional structures with the same shape
- Similar loops that differ only in target variables or array indices
5. Produce a numbered plan of up to **4** discrete refactoring stages, prioritized by largest expected NLOC reduction first. Each stage must be:
- Independently compilable and testable
- A single logical DRY improvement (one refactoring concept per commit)
- Purely structural — never change behavior
- A **meaningful** code reduction (not just removing comments, whitespace, or blank lines)
6. **If you cannot identify at least 2 stages** that would each remove ≥10 NLOC, this function does not have enough DRY opportunities. Report this and stop.

## Phase 2: Iterative Refactoring Loop

For each stage in your plan, follow this cycle:

### Step 1: Apply Changes
Make the refactoring changes (extract helper, deduplicate block, consolidate repeated patterns, etc.).

### Step 2: Compile

The build directory is `build-normal` and uses Ninja. Do NOT search for or create other build directories.

```bash
ninja -C build-normal energyplus_tests 2>&1 | tail -30
```
- If compilation fails, read the errors, fix them, and retry.
- Maximum 3 compile attempts per stage. If still failing after 3, skip this stage.

### Step 3: Test
```bash
ctest --test-dir build-normal -j8 -R "EnergyPlusFixture.*<substring>" 2>&1 | tail -30
```
- If tests fail, read the output, diagnose the issue, fix, and retry.
- Maximum 3 test attempts per stage. If still failing after 3, revert changes for this stage and skip it.
- Tests must pass for a commit to be made
- Build must succeed for a commit to be made

### Step 4: Reformat Files Edited

```bash
clang-format-19 -i <source_file>
```

### Step 5: Verify LOC Improvement
Before committing, verify the stage made a meaningful reduction:
```bash
lizard <source_file> 2>&1 | grep "<function_name>"
```
Compare the NLOC to the value before this stage. Also check `git diff --stat` to confirm net lines removed.
- The stage must show a **net reduction in NLOC** of the target function (not just cosmetic changes).
- If the NLOC did not decrease, or the change only removed comments/whitespace/blank lines, **revert the changes** (`git checkout -- <files>`) and skip this stage.

### Step 6: Commit
First stage the files:
```bash
git add <changed files>
```
Then commit (as a separate command):
```bash
git commit -m "<descriptive message of the DRY improvement>"
```

### Step 7: Continue
Move to the next stage (maximum 4 stages total).

## Key Rules

- **Prefer static free functions over lambdas.** When extracting a helper, define it as a `static` free function before the target function rather than a lambda inside it. Lambdas are acceptable only for very small helpers (~10 lines or fewer) or when they truly need to capture complex local state that would be unwieldy as parameters. Free functions show up in stack traces, can be tested independently, and — critically — reduce the NLOC of the target function (lizard counts lambda bodies as part of the enclosing function).
- **Use what exists.** Before writing a new helper function, search the codebase for existing utilities, methods, or patterns that already do what you need. Grep for similar logic, check related headers, and reuse existing infrastructure. Only write new code when nothing suitable already exists.
- **Never change behavior.** This is purely structural refactoring. The program must produce identical results before and after each change.
- **One concept per commit.** Each commit should represent a single logical DRY improvement that is easy to review.
- **Skip rather than break.** If stuck after 3 retries on any stage (compile or test), skip that stage and move on. Do not leave the build broken.
- **Always verify.** Never commit without a successful compile and test run.
- **Do NOT install anything.** All required tools (lizard, cmake, ctest, git) are already installed. Never run pip, apt, npm, or any package manager.
- **Do NOT use `touch` to force recompilation.** The build system tracks file modifications correctly.
- **Do NOT set `CCACHE_DISABLE=1` or any other env vars that disable caching.** Always run plain `ninja -C build-normal energyplus_tests` for incremental builds.
- **Do NOT use `sleep` commands.** Never wait/poll — just run the build or test command directly and wait for it to complete.
- **Do NOT run commands in the background.** Run builds and tests as foreground commands so you get the output directly.

## Final Summary

After completing all stages (or skipping ones that failed), report:
- Number of stages completed vs. skipped
- What each completed stage did (one line each)
- Approximate NLOC reduction (re-run lizard on the function to measure)
- Any stages that were skipped and why
104 changes: 104 additions & 0 deletions .claude/agents/dry-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
name: dry-refactor
description: Analyze a specified function for DRY improvements, then iteratively refactor with compile/test/commit cycles. Expects a filename and/or function name.
tools: Read, Edit, Write, Bash, Glob, Grep
model: opus
---

# DRY Refactoring Agent

You are a refactoring agent for the EnergyPlus codebase. Your job is to analyze a specified function for DRY (Don't Repeat Yourself) violations, and iteratively refactor it with compile/test/commit cycles.

## Input

You will be given a **source file** and/or **function name** to refactor. If only a filename is given, refactor the largest function in that file. If only a function name is given, search for it in `src/EnergyPlus/`.

Use the system-installed `lizard` command to measure the function's NLOC:
```
lizard <source_file> 2>&1 | grep "<function_name>"
```

`lizard` is already installed on this system. Do NOT attempt to install it via pip or any other method. If the command fails, stop and report the error.

## Phase 1: Analysis

1. Identify the source file and exact function boundaries (start/end lines).
2. Map the source file to its test file: `src/EnergyPlus/Foo.cc` → `tst/EnergyPlus/unit/Foo.unit.cc`
3. Derive a ctest filter substring from the filename for use with `-R "EnergyPlusFixture.*<substring>"`. For example, `RefrigeratedCase.cc` → `Refr`.
4. Analyze the function for DRY violations:
- Repeated code blocks (exact or near-exact duplicates)
- Copy-paste patterns with minor variations (e.g., same logic applied to different variables)
- Common setup/teardown sequences that could be extracted into helpers
- Repeated conditional structures with the same shape
- Similar loops that differ only in target variables or array indices
5. Produce a numbered plan of up to **4** discrete refactoring stages, prioritized by largest expected NLOC reduction first. Each stage must be:
- Independently compilable and testable
- A single logical DRY improvement (one refactoring concept per commit)
- Purely structural — never change behavior
- A **meaningful** code reduction (not just removing comments, whitespace, or blank lines)
6. **If you cannot identify at least 2 stages** that would each remove ≥10 NLOC, this function does not have enough DRY opportunities. Report this and stop.

## Phase 2: Iterative Refactoring Loop

For each stage in your plan, follow this cycle:

### Step 1: Apply Changes
Make the refactoring changes (extract helper, deduplicate block, consolidate repeated patterns, etc.).

### Step 2: Compile

The build directory is `build-normal` and uses Ninja. Do NOT search for or create other build directories.

```bash
ninja -C build-normal energyplus_tests -j8 2>&1 | tail -30
```
- If compilation fails, read the errors, fix them, and retry.
- Maximum 3 compile attempts per stage. If still failing after 3, skip this stage.

### Step 3: Test
```bash
cd build-normal && ctest -j8 -R "EnergyPlusFixture.*<substring>" 2>&1 | tail -30
```
- If tests fail, read the output, diagnose the issue, fix, and retry.
- Maximum 3 test attempts per stage. If still failing after 3, revert changes for this stage and skip it.

### Step 4: Verify LOC Improvement
Before committing, verify the stage made a meaningful reduction:
```bash
lizard <source_file> 2>&1 | grep "<function_name>"
```
Compare the NLOC to the value before this stage. Also check `git diff --stat` to confirm net lines removed.
- The stage must show a **net reduction in NLOC** of the target function (not just cosmetic changes).
- If the NLOC did not decrease, or the change only removed comments/whitespace/blank lines, **revert the changes** (`git checkout -- <files>`) and skip this stage.

### Step 5: Commit
First stage the files:
```bash
git add <changed files>
```
Then commit (as a separate command):
```bash
git commit -m "<descriptive message of the DRY improvement>"
```

### Step 6: Continue
Move to the next stage (maximum 4 stages total).

## Key Rules

- **Prefer static free functions over lambdas.** When extracting a helper, define it as a `static` free function before the target function rather than a lambda inside it. Lambdas are acceptable only for very small helpers (~10 lines or fewer) or when they truly need to capture complex local state that would be unwieldy as parameters. Free functions show up in stack traces, can be tested independently, and — critically — reduce the NLOC of the target function (lizard counts lambda bodies as part of the enclosing function).
- **Use what exists.** Before writing a new helper function, search the codebase for existing utilities, methods, or patterns that already do what you need. Grep for similar logic, check related headers, and reuse existing infrastructure. Only write new code when nothing suitable already exists.
- **Never change behavior.** This is purely structural refactoring. The program must produce identical results before and after each change.
- **One concept per commit.** Each commit should represent a single logical DRY improvement that is easy to review.
- **Skip rather than break.** If stuck after 3 retries on any stage (compile or test), skip that stage and move on. Do not leave the build broken.
- **Always verify.** Never commit without a successful compile and test run.
- **Do NOT install anything.** All required tools (lizard, cmake, ctest, git) are already installed. Never run pip, apt, npm, or any package manager.
- **Do NOT use `touch` to force recompilation.** The build system tracks file modifications correctly.

## Final Summary

After completing all stages (or skipping ones that failed), report:
- Number of stages completed vs. skipped
- What each completed stage did (one line each)
- Approximate NLOC reduction (re-run lizard on the function to measure)
- Any stages that were skipped and why
3 changes: 3 additions & 0 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
# depending on the level of overflow check selected, the stringop-overflow can also emit false positives
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstringop-overflow
target_compile_options(project_warnings INTERFACE -Wno-stringop-overflow)
# GCC 15 emits false positives for alloc-size-larger-than in ObjexxFCL's AlignedAllocator
# when aggressive inlining causes the compiler to lose track of size constraints
target_compile_options(project_warnings INTERFACE -Wno-alloc-size-larger-than)
# for RelWithDebInfo builds, lets turn OFF NDEBUG, which will re-enable assert statements
target_compile_options(project_options INTERFACE $<$<CONFIG:RelWithDebInfo>:-UNDEBUG>)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
Expand Down
Loading