-
Notifications
You must be signed in to change notification settings - Fork 397
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
Integrate breaking changes in btwxt interface, including error logging via interface injection. #10160
Conversation
…-btwxt-error-handling
…-btwxt-error-handling
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 had a few comments, but nothing major. The most major is probably the question about the severe error and whether it leads to a fatal. But this PR is still marked as draft, so I'll just leave this for now.
@@ -253,7 +253,7 @@ add_subdirectory(third_party) | |||
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/src) | |||
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party) | |||
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/fmt-8.0.1/include) | |||
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/btwxt/src) | |||
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/btwxt/include) |
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.
👍
@@ -6941,9 +6941,9 @@ namespace AirflowNetwork { | |||
|
|||
std::vector<Real64> dirs30 = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360}; | |||
std::vector<Btwxt::GridAxis> dirs30Axes; | |||
dirs30Axes.emplace_back(dirs30, Btwxt::Method::LINEAR, Btwxt::Method::LINEAR, std::pair<double, double>{0.0, 360.0}); | |||
dirs30Axes.emplace_back(dirs30, "", Btwxt::Method::linear, Btwxt::Method::linear, std::pair<double, double>{0.0, 360.0}); |
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.
This is fine, but I do wonder what the new empty string constructor argument will be as I read along...
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.
These have now been populated. I'm not sure if the string literal should be pulled out into its own variable; if it moved beyond the two local uses I'd do that.
src/EnergyPlus/CMakeLists.txt
Outdated
@@ -757,6 +757,7 @@ target_link_libraries( | |||
DElight | |||
libkiva | |||
btwxt | |||
courierr |
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.
What is courierr?
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.
The target link didn't need to be here, so it's been removed. But, courierr is Big Ladder's current lightweight error-logging interface. The idea is that a client user would provide a concrete implementation of the courierr interface as an injected dependency, rather than an old C-style callback, to handle logging.
At the moment, there is a bit of a proliferation of those concrete implementations (in this and an upcoming PR). Neal and I intend to merge those into a single central class that anything in E+ can use.
src/EnergyPlus/CurveManager.cc
Outdated
thisCurve->TableIndex = gridIndex; | ||
thisCurve->GridValueIndex = state.dataCurveManager->btwxtManager.addOutputValues(gridIndex, lookupValues); | ||
} catch (Btwxt::BtwxtException &e) { | ||
ShowSevereError(state, "GridAxis construction error."); |
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.
Should this lead to a fatal error? Does 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.
Yes, and fixed.
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.
IMHO, I wish that the third party libs had "lightweight" releases that could be brought into our repo without docs/tests/readme/etc. Just the code, dependencies, and build rules. It's not a big deal, just a comment.
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.
The last check-in should be more lightweight.
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 actually thought that nlohmann provided a single-file include-only header option. I could definitely be wrong there though. But if that was the case, it would be really nice to just use that.
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.
Modified as discussed on Slack; we'll see if everything is still happy.
…-btwxt-error-handling
… get initialized with RSes.
…-btwxt-error-handling
Currently, the Windows 10 build shows a build warning emanating from alphanum.hpp. The cause appears to be the custom E+ use of alphanum in the nlohmann json header; the EnergyPlus implementation of json changed nlohmann's |
There is something wrong with the error reporting here...check out this ERR diff http://energyplus.s3-website-us-east-1.amazonaws.com/regressions/2023-10/7636e6b3e972dad33c41815304938b2139dde367-1bf2590b9b5581199ecd76c704e2b5b445ef2846/ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205/x86_64-MacOS-10.17-clang-14.0.0/eplusout.err.diff.html |
@mbadams5 do you have a second to look at the compiler warning being emitted from doj/alphanum on Windows? This PR doesn't change that file that I can see, but something is causing it to be emitted. It is an odd looking expression in there, but that code looks like magic in a number of places, so that's not surprising. |
Wow, there sure is. I'm afraid I don't remember if this was a known issue that I addressed or not. I'll look into it. |
Looks like I'd missed an implementation detail! I'm checking in a fix now. |
@tanaya-mankad thanks for fixing this up. It looks totally ready. I've got several PRs that I need to line up for merging, but it appears that I don't need anything else here. This should merge today. |
Thank you @Myoldmopar ! |
This has waited long enough, and tests out all happily here, merging. Thanks @tanaya-mankad |
Pull request overview
The btwxt interpolation library underwent a major restructuring, and changes needed to be propagated to client code. Changes include new constructors, removal of internal intermediate objects from the public interface, and most importantly, a per-instance error handling policy that uses a custom error-handling class injected into the btwxt constructors (rather than the previous global error handling callback mechanism.) The libtk205 dependency was also updated, as it depends on btwxt.
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.