Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 9215 central heat pump schedule #9226

Merged

Conversation

jcyuan2020
Copy link
Contributor

Pull request overview

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@jcyuan2020 jcyuan2020 added the Defect Includes code to repair a defect in EnergyPlus label Jan 5, 2022
@Myoldmopar
Copy link
Member

Is this still draft or ready to go?

@jcyuan2020
Copy link
Contributor Author

Set to ready for view.

@jcyuan2020 jcyuan2020 marked this pull request as ready for review January 6, 2022 23:11
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

The change looks good, and the unit test seems sufficient, but it does need a small tweak. At least the removal of the unused variable, and more preferable just not calling the factory at all, per my comment. Please address that either way and push it up and this should be ready to go. Also, is there a defect file for this?

// call the factory with a valid name to trigger reading inputs
state->dataPlantCentralGSHP->getWrapperInputFlag = true;

auto compPtr = PlantCentralGSHP::WrapperSpecs::factory(*state, "CHW_LOOP HEATPUMP1");
Copy link
Member

Choose a reason for hiding this comment

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

This compPtr is unused and throwing a warning from the compiler. I'm guessing you probably don't need to call the PlantComponent wrapper function anyway though, and instead just call the GetWrapperInput function instead (which the factory probably does anyway...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Defect file added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change is also done now. It calling the "GetWrapperInput()' function directly, with some minor changes in the idf snippet, e.g. added a schedule.

auto compPtr = PlantCentralGSHP::WrapperSpecs::factory(*state, "CHW_LOOP HEATPUMP1");

// verify that under this scenario of not finding a schedule match, ScheduleAlwaysOn is the treated default
EXPECT_EQ(state->dataPlantCentralGSHP->Wrapper(1).WrapperComp(1).CHSchedPtr, DataGlobalConstants::ScheduleAlwaysOn);
Copy link
Member

Choose a reason for hiding this comment

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

Reasonable assertion for the unit test 👍

ShowContinueError(
state, " in the object " + state.dataIPShortCut->cCurrentModuleObject + "= " + state.dataIPShortCut->cAlphaArgs(1));
ShowContinueError(state, "The Control Schedule is treated as AlwaysOn instead.");
}
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this is fine with me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! The changes have been pushed, waiting for the ci results.

@Myoldmopar
Copy link
Member

Windows build failed but unrelated to this, it's fine. Develop has moved a good amount since the last run so I'd want to do at least a local test/regression run before merging, but I think this should still be ready to go in, right?

@jcyuan2020
Copy link
Contributor Author

@Myoldmopar Yes, it should be good to go. Would you like me to push a commit that merged with most recent develop or you want to do that locally on your PC?

@Myoldmopar
Copy link
Member

I pulled develop into the branch locally and am building/testing. If it is all good it'll merge here in a bit. Thanks.

@Myoldmopar
Copy link
Member

All tests pass locally with develop pulled in, including regressions which are fully clean. Merging this, thanks @jcyuan2020

@Myoldmopar Myoldmopar merged commit c036df2 into NREL:develop Jan 15, 2022
yujiex pushed a commit that referenced this pull request Jan 27, 2022
…chedule

Fix 9215 central heat pump schedule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
7 participants