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 glass U factor sql error #4681

Merged
merged 12 commits into from Sep 15, 2022
Merged

Fix glass U factor sql error #4681

merged 12 commits into from Sep 15, 2022

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Sep 13, 2022

Pull request overview

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • 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

@joseph-robertson joseph-robertson added Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. component - Model labels Sep 13, 2022
@jmarrec jmarrec marked this pull request as ready for review September 15, 2022 07:22
Comment on lines +345 to +352
std::string query = R"(SELECT Value from TabularDataWithStrings
WHERE ReportName = 'EnvelopeSummary'
AND ReportForString = 'Entire Facility'
AND TableName = 'Opaque Exterior'
AND ColumnName = 'U-Factor with Film'
AND Units='W/m2-K'
AND RowName = ?;)";
outputResult = sqlFile->execAndReturnFirstDouble(query, to_upper_copy(*subSurfaceName));
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 smart!


ASSERT_TRUE(surface->uFactor());
double uFactor = surface->uFactor().get();
EXPECT_TRUE(openstudio::equal(0.310, uFactor, 1.0E-3));
Copy link
Collaborator

Choose a reason for hiding this comment

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

EXPECT_DOUBLE_EQ(val1, val2) is meant for this, and will report a nicer output in case it fails.

Verifies that the two double values val1 and val2 are approximately equal, to within 4 ULPs from each other.

If you need a specific tolerance (I don't think you do), then use EXPECT_NEAR(val1, val2, abs_error)

src/model/test/Surface_GTest.cpp Outdated Show resolved Hide resolved
@ci-commercialbuildings
Copy link
Collaborator

ci-commercialbuildings commented Sep 15, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. severity - Normal Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Glass U Factor sql error
3 participants