Skip to content

Coil API Refactor (Part III -- move GetCoilInputs to init_state())#11548

Open
amirroth wants to merge 16 commits into
developfrom
CoilAPI2
Open

Coil API Refactor (Part III -- move GetCoilInputs to init_state())#11548
amirroth wants to merge 16 commits into
developfrom
CoilAPI2

Conversation

@amirroth
Copy link
Copy Markdown
Collaborator

The coil API refactor continues. Here, the various GetCoilInput functions are moved to init_state() and hilarity/madness ensues.

@amirroth amirroth added Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring NotIDDChange Code does not impact IDD (can be merged after IO freeze) labels Apr 27, 2026
@amirroth
Copy link
Copy Markdown
Collaborator Author

This PR changes variable/meter and node numbering and broke all unit tests that rely on hard-coded numbers for these, a few for meters, many more for nodes. I have been able to fix most of these, but a few remain:

  • EnergyPlusFixture.AirflowNetwork_CheckMultistageHeatingCoil
  • EnergyPlusFixture.AirflowNetwork_DuctSizingTest
  • EnergyPlusFixture.AirflowNetwork_TestFanModel
  • EnergyPlusFixture.AirflowNetwork_UserDefinedDuctViewFactors

I tried a few fixes in one of the tests (I think the first one) and they didn't work for reasons that I couldn't parse. AirflowNetwork has its own parallel node logic that I probably needed to fix also. May need @jasondegraw help in fixing these up.

  • EnergyPlusFixture.ExerciseHVACDXHeatPumpSystem
  • EnergyPlusFixture.SimulationManager_OutputDebuggingData
  • EnergyPlusFixture.UnitHeater_HWHeatingCoilUAAutoSizingTest

Cannot get these to reproduce locally (mac arm64). Strangely, my local build had some other broken unit tests (e.g., in WaterCoilsTest fixture) that didn't show up in CI. I don't know how to handle these.

  • EnergyPlusFixture.MixedAir_HXBypassOptionTest

This test uses very strange node number arithmetic that makes no sense to me. I tried to fix it both the way it was and the way I thought it should have been and neither of them worked.

There is also a broken integration test that I need some advice on how to approach.

@mitchute mitchute requested a review from jasondegraw May 6, 2026 18:26
@jasondegraw
Copy link
Copy Markdown
Member

@amirroth I fixed the AFN unit test that output the most useful information on the failure on Windows, the others will take a little bit more digging but seem to be somewhat similar so far.

It looks like the coil was previously underspecified but wasn't
hitting the validation in the test.
This one was failing on an infinite loop, there's protection
against that now but may have unintended consequences.
@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 4ca3724

Regression Summary
  • BND: 601
  • ERR: 259
  • EDD: 30
  • MDD: 585
  • MTD: 600
  • RDD: 589
  • ESO Small Diffs: 70
  • MTR Small Diffs: 132
  • JSON Big Diffs: 1
  • EIO: 36
  • Table String Diffs: 25
  • Audit: 7
  • Table Big Diffs: 6
  • ESO Big Diffs: 1
  • MTR Big Diffs: 2
  • PERF_LOG: 3
  • Table Small Diffs: 2

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit e5bbc15

Regression Summary
  • BND: 601
  • ERR: 259
  • EDD: 30
  • MDD: 585
  • MTD: 600
  • RDD: 589
  • ESO Small Diffs: 70
  • MTR Small Diffs: 132
  • JSON Big Diffs: 1
  • EIO: 36
  • Table String Diffs: 25
  • Audit: 7
  • Table Big Diffs: 6
  • ESO Big Diffs: 1
  • MTR Big Diffs: 2
  • PERF_LOG: 3
  • Table Small Diffs: 2

Copy link
Copy Markdown
Member

@jasondegraw jasondegraw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the four failing AFN unit tests with changes that are mainly OK. I made a couple of comments on the fixes. The branch seems to have a whitespace problem, git was a bit confused about changes, but Windows may not have helped with that.

});

ASSERT_TRUE(process_idf(idf_objects));
state->init_state(*state);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change may run counter to the purpose of this branch, but I'll argue that the purpose of the unit test is (most likely) to check all of the AFN checks that happen in the test and not that the other parts of the model are set up correctly. Because they probably aren't.

DuctSizingSBFlag = true;
}
while (NodeNum1 != NodeSplitter) {
bool foundNextDuct = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this boolean as part of a trapdoor to prevent an infinite loop failure. This came up in one of the failing unit tests, it then failed more normally, but the approach itself is risky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NotIDDChange Code does not impact IDD (can be merged after IO freeze) Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants