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
Addresses #4946, allow TableLookup curves for Coil:*:WaterToAirHeatPump:EquationFit objects #4950
Conversation
} | ||
|
||
bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve) { | ||
bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingCapacityCurve(const Curve& heatingCapacityCurve) { |
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 specifically expects a QuadvariateFunctions
one in the IDD. Should we check that heatingCapacityCurve.numVariables() == 4
here?
Genuine question. Not saying we should necessarily, but since this is the general move of E+ to allow generic curve and table objects everywhere, this is bound to come up again, I think now's a good time to decide what to do/standardize. @kbenne @joseph-robertson
Pros:
- Checking is good because it catches user errors early instead of letting E+ complain (via
CheckCurveDim
)
Cons:
- More work for us
- Options:
- Option1: we are hardcoding a
curve.numVariables()
check in each setter that takes a genericCurve
, which potentially could fall out of date (though in this case I don't see why the number of expected independent variables would change suddenly in E+) - Option 2: The alternative is to add a special case in
WorkspaceObject_Impl::setPointer
or a new methodWorkspaceObject_Impl::setCurvePointer
- A new check in
setPointer
is going to impose a performance penalty for all objects - A new method specifically for Curves means we gotta be careful to use this one specifically for curves
- A new check in
- Option1: we are hardcoding a
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.
actually for option 2, the best option is probably to a new bool ModelObject_Impl::setCurve(unsigned index, const Curve& curve)
method that would check the IDD references and do the numVariables() check for us before setting the handle via WorkspaceObject_Impl::setPointer
(or WorkspaceObject_Impl::setString
for speed).
That'd avoid having to do lots of shenanigans in Workspace land to figure out the number of variables a Table object has.
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.
Increasingly, I'm starting to appreciate some value in not making OpenStudio too smart and therefore letting EnergyPlus report certain errors. I wouldn't be opposed to just accepting the generic Curve
type throught OpenStudio and letting EnergyPlus report if there are errors.
That said if we do go with validation in OpenStudio then option 2, but with a new ::setCurve method seems right. Paying the performance penality for every call to the existing ::setPointer seems unacceptable to me.
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'm opening an issue here, that we may just end up closing. I realize the Curve objects are already fine (via the \reference
check), only the TableLookup has this issue:
CI Results for b0f6f2e:
|
Pull request overview
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.