-
Notifications
You must be signed in to change notification settings - Fork 389
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
Added Field to Site:Location to Allow Weather File Location Data to be Overwritten by User Info #10586
Conversation
Implementation of a new feature to allow the user to allow the user to still use the Site:Location designation even when a weather file exists. Currently, if a weather file exists, it always overwrite the Site:Location information. This allows the user to choose. Commit includes modifications to the IDD, code to read in the new input and handle it properly within the code, and a new input file that shows that the Site:Location information is kept when requested by the user. Expecting no changes in existing IDFs since the default is to maintain the status quo from previous editions.
Forgot to do the clang format check before making a commit. Oops...
Addition of a unit test that exercises two different subroutines impacted by the work for this new feature. Also, documentation additions/revisions were made. This commit is a candidate PR.
!-Option OriginalOrderTop UseSpecialFormat | ||
!-NOTE: All comments with '!-' are ignored by the IDFEditor and are generated automatically. | ||
!- Use '!' comments if they need to be retained when using the IDFEditor. | ||
! 5ZoneAirCooled.idf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example file name. I'm not really a fan of adding new example files when this feature could be added to an existing example file. Repo size, local install size, time to test regression, etc. are impacted with each new example file. But I do understand the need for specific example files to fail, because of future code changes, for specific reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that we don't want to just add files without real need. I can always remove this file and simply change an existing file. So, would you prefer that I do that or just correct the example file name, leaving the new example file in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have an opinion, the action is yours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just committed a change that corrects the example file name shown in the comment and also adds an additional comment to explain what this file does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see both sides here. In this case, since it is a complete change in "how the file runs" or whatever we want to call it, I don't mind it being in a standalone file. If we were, for example, adding a new field to a chiller, we'd probably want to just modify an existing chiller test file.
src/EnergyPlus/WeatherManager.cc
Outdated
max(state.dataEnvrn->Elevation, 1.0) * 100.0), | ||
std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation))); | ||
if (state.dataWeather->keepUserSiteLocationDefinition) { | ||
ShowWarningError(state, "User Entered (IDF) Site:Location object will be used rather than the weather file location."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user said to use the site location, is a message really needed to verify that choice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I didn't see this as "required" but thought it was simply a helpful "confirmation". Do you want me to take this out? I don't have a problem removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would rather not see a confirmation of an input. I also don't see a change to the eio. Not sure if that's needed but ...
! <Site:Location>, Location Name, Latitude {N+/S- Deg}, Longitude {E+/W- Deg}, Time Zone Number {GMT+/-}, Elevation {m}, Standard Pressure at Elevation {Pa}, Standard RhoAir at Elevation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit that was just made, I got rid of this confirmation message. As far as the EIO is concerned, it's going to show the correct location title based on the new field in Site:Location. That won't show any changes in IDFs that already existed because these all use the default of "No" which means no change from what was done before. If you change any existing input file to "Yes" you will see a change in the EIO. So, I don't think there needs to be any change to the code that produces the EIO unless I am missing something or misunderstood your point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah a default of No, to ensure unchanged behavior by default, is good.
A note to potential reviewers. With the latest commit entitled Correct Logic Error in #10579 (ef51925), the differences in tables seem to all relate to the fact that a new input field added a new default value. To me, that is expected because the IDD has changed. So, while there are lots of changes, I think they are "expected" and correct. |
Got rid of an unnecessary error message (also required modifications to unit test) and corrected file name shown in the comments of the new file. Also added some notes to the new IDF to explain what it's purpose is.
Sure, that makes sense, they look like just a bunch of expected table diffs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a code only perspective, this seems pretty reasonable. A new optional field on an existing object, some relevant code changes, with accompanying doc updates, a new example file, and a nice unit test. Nothing further inside here. The real bulk of reviewing this is about the impact and side effects of such a change.
Pull request overview
Site:Location
should not be overridden by weather file #10579NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.