Skip to content

Coil API Refactor (Part II -- simplify ReportCoilSelection)#11517

Merged
mitchute merged 12 commits intodevelopfrom
ReportCoil
Apr 22, 2026
Merged

Coil API Refactor (Part II -- simplify ReportCoilSelection)#11517
mitchute merged 12 commits intodevelopfrom
ReportCoil

Conversation

@amirroth
Copy link
Copy Markdown
Collaborator

Second part of the Coil API refactor. This part simplifies ReportCoilSelection which was unnecessarily "object-oriented".

@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 11, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit b0f88d7

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit b0f88d7

Regression Summary
  • ESO Small Diffs: 705
  • Table Small Diffs: 383
  • MTR Small Diffs: 523
  • Table String Diffs: 196
  • EIO: 396
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 72
  • Table Big Diffs: 49
  • ERR: 14
  • MTR Big Diffs: 2
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit ed8144e

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit ed8144e

Regression Summary
  • ESO Small Diffs: 705
  • Table Small Diffs: 383
  • MTR Small Diffs: 523
  • Table String Diffs: 196
  • EIO: 396
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 72
  • Table Big Diffs: 49
  • ERR: 14
  • MTR Big Diffs: 2
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2

Copy link
Copy Markdown
Collaborator Author

@amirroth amirroth left a comment

Choose a reason for hiding this comment

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

Maybe the simplest PR I've ever had. Certainly top five.

if (this->isCoilReportObject) {
state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(
state, this->compName, this->compType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum);
ReportCoilSelection::setCoilEntAirTemp(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is basically the only type of change in the entire PR. A lot of search-replace and letting the compiler flag the remaining changes that need to be performed by hand.

#endif // GET_OUT
};

#ifdef GET_OUT
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Eliminated these while I was at it.


extern const std::array<bool, (int)CoilType::Num> coilTypeIsHeatPump;

#ifdef GET_OUT
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

And these.

HVAC::CoilType heatCoilType = HVAC::CoilType::Invalid;

HVAC::CoilType coilType = HVAC::CoilType::Invalid;
int coilReportNum = -1;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Every coil now has a coilReportNum variable which is assigned when the coil is first created.

heatingCoil.heatCoilType = HVAC::CoilType::HeatingElectric;
heatingCoil.coilType = HVAC::CoilType::HeatingElectric;

heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Create coil, assign coilReportNum.

struct ReportCoilSelectionData : BaseGlobalStruct
{

std::unique_ptr<ReportCoilSelection> coilSelectionReportObj;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There is no need for this embedded object just to make the module interface "object-oriented". Object-orientation is in quotes because it wasn't even being applied to the correct object, it was being applied to the container object rather than the individual coilReport objects, i.e., coilContainerObject->setCoilData(coilNum, data); instead of coilReportObject->setCoilData(data);. Anyways, I made this into a simple procedural API.

@amirroth
Copy link
Copy Markdown
Collaborator Author

⚠️ Regressions detected on ubuntu-24.04 for commit ed8144e

Regression Summary

  • ESO Small Diffs: 705

  • Table Small Diffs: 383

  • MTR Small Diffs: 523

  • Table String Diffs: 196

  • EIO: 396

  • JSON Small Diffs: 2

  • ZSZ Small Diffs: 72

  • Table Big Diffs: 49

  • ERR: 14

  • MTR Big Diffs: 2

  • EDD: 4

  • ESO Big Diffs: 10

  • SSZ Small Diffs: 13

  • JSON Big Diffs: 2

  • View Results

  • Download Regressions

Is something still wrong with the Ubuntu runner? I don't understand how this type of PR can generate these types of diffs.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit ed8144e

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit ed8144e

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 31a87d5

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 31a87d5

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@mitchute
Copy link
Copy Markdown
Collaborator

Is something still wrong with the Ubuntu runner? I don't understand how this type of PR can generate these types of diffs.

I had a theory this morning, so I reran regressions a couple times. But that theory didn't pan out. I'll keep hunting.

The latest rerun + local testing is showing that some of the table diffs are real.

@amirroth
Copy link
Copy Markdown
Collaborator Author

Is something still wrong with the Ubuntu runner? I don't understand how this type of PR can generate these types of diffs.

I had a theory this morning, so I reran regressions a couple times. But that theory didn't pan out. I'll keep hunting.

The latest rerun + local testing is showing that some of the table diffs are real.

I'm more inclined to believe the MacOS diffs (which have two kinds of diffs including table big diffs) in 14 files than the Ubuntu diffs (which have 16 kinds of diffs in 400 files).

@mitchute
Copy link
Copy Markdown
Collaborator

mitchute commented Apr 14, 2026

Late edit:

I'm more inclined to believe the MacOS diffs (which have two kinds of diffs including table big diffs) in 14 files than the Ubuntu diffs (which have 16 kinds of diffs in 400 files).

The latest Ubuntu regressions show this as well.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 2820989

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 2820989

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@amirroth
Copy link
Copy Markdown
Collaborator Author

Late edit:

I'm more inclined to believe the MacOS diffs (which have two kinds of diffs including table big diffs) in 14 files than the Ubuntu diffs (which have 16 kinds of diffs in 400 files).

The latest Ubuntu regressions show this as well.

Thanks. I will focus on those.

@amirroth
Copy link
Copy Markdown
Collaborator Author

Late edit:

I'm more inclined to believe the MacOS diffs (which have two kinds of diffs including table big diffs) in 14 files than the Ubuntu diffs (which have 16 kinds of diffs in 400 files).

The latest Ubuntu regressions show this as well.

Thanks. I will focus on those.

These diffs are due to coils appearing in the tables in different orders. I thought that Edwin had modified the table comparison script to handle this case, but maybe not. Or maybe it is not applied to all tables.

@mitchute
Copy link
Copy Markdown
Collaborator

I thought that Edwin had modified the table comparison script to handle this case, but maybe not.

Let me look into the what the regression tool is doing. I also thought that. I just rans some tests locally and I do see that in the coil sizing summary table, the Coil Type column entries have changed from title case to all caps. I doubt that's the problems, but I'll check.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 5e2db3f

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 5e2db3f

Regression Summary
  • Table Big Diffs: 14
  • Table String Diffs: 14

Comment thread src/EnergyPlus/ReportCoilSelection.cc Outdated
std::string tmpZoneList;
for (const auto &vecLoop : c->zoneName) {
tmpZoneList += vecLoop + "; ";
state, state.dataOutRptPredefined->pdchCoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The capitalization "issue" is here.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 5e2db3f

Regression Summary
  • Table String Diffs: 520

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 5e2db3f

Regression Summary
  • Table String Diffs: 520

@mitchute
Copy link
Copy Markdown
Collaborator

I reworked the regression tool to do a better job reporting table diffs and handling cases where the rows have been reordered. That has been deployed, and I've reran the workflow on the latest commit. The regression results posted here now are consistent with what we discussed above.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit f941699

Regression Summary
  • Table String Diffs: 571

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit f941699

Regression Summary
  • Table String Diffs: 571

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 82592ff

Regression Summary
  • Table String Diffs: 409

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 82592ff

Regression Summary
  • Table String Diffs: 409

@amirroth
Copy link
Copy Markdown
Collaborator Author

I reworked the regression tool to do a better job reporting table diffs and handling cases where the rows have been reordered. That has been deployed, and I've reran the workflow on the latest commit. The regression results posted here now are consistent with what we discussed above.

So, the existing capitalization behavior is inconsistent. Most coil types are reported in TitleCase but a few (mostly heating coils from the looks of it) are reported UPPERCASE. In this branch, all coil types are reported in TitleCase. I think that is preferred even if it is technically a diff.

@mitchute
Copy link
Copy Markdown
Collaborator

mitchute commented Apr 22, 2026

In this branch, all coil types are reported in TitleCase. I think that is preferred even if it is technically a diff.

I agree. I did a few quick spot check, and it all looks OK. I deleted and restarted that failing test. It should report back shortly and we can merge this.

@mitchute
Copy link
Copy Markdown
Collaborator

All good here. Merging.

@mitchute mitchute merged commit f53594d into develop Apr 22, 2026
11 checks passed
@mitchute mitchute deleted the ReportCoil branch April 22, 2026 03:18
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.

3 participants