Skip to content

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

Open
amirroth wants to merge 8 commits intodevelopfrom
ReportCoil
Open

Coil API Refactor (Part II -- simplify ReportCoilSelection)#11517
amirroth wants to merge 8 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.

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