-
Notifications
You must be signed in to change notification settings - Fork 63
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
Forcings Engine Data Provider Base Interface #839
Forcings Engine Data Provider Base Interface #839
Conversation
The shadowed variable |
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.
Maybe good to let others have a look, or see what the derived classes look like, but I think this is all good.
fd03f30
to
b8471cc
Compare
The main header here can only be included with |
Co-authored-by: Phil Miller - NOAA <[email protected]>
Co-authored-by: Phil Miller - NOAA <[email protected]>
20ae487
to
b01255d
Compare
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 dont see any problems
//! Utility function for ForcingsEngineLumpedDataProvider constructor. | ||
time_t parse_time(const std::string& time, const std::string& fmt); | ||
|
||
//! Check that requirements for running the forcings engine |
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.
Since this is probably a fatal error on this function is fine I would still want a check form of the function but it is not important
std::string init_; | ||
|
||
//! Calendar time for simulation beginning | ||
clock_type::time_point time_begin_{}; |
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.
We probably need an official style rule on member data names (or names in general), we have at least 4 styles used between various files
Important
This PR replaces #720.
This PR adds the
ForcingsEngineDataProvider<DataType, SelectionType>
class. This class is intended to serve as the base class for Lumped, Gridded, and Unstructured forcings engine data providers. The base class handles timing and updating the underlying BMI instance, so derived classes need only implement the value querying requirements.Internally, this PR also adds the
detail::ForcingsEngineStorage
class, which composes a map of initialization file names to Python BMI Adapter shared pointers. The design of this is to allow the Forcings Engine data providers to store a mask of some sort to simplify querying from the forcings engine, i.e. for a Gridded instance, the mask may be a bounding box. This need is due to the implementation of the forcings engine, and should simplify the external requirements for a NGen run using the Python Forcings Engine.Additionally, this PR includes some minor changes to the
forcings
library. Namely, theGenericDataProvider
class is refactored into a type alias, and theNullForcingProvider
implementation is split into header/source files rather than being header-only. The latter change is to ensure theforcings
CMake target is always build-able.Additions
ForcingsEngineDataProvider
: templated base class.detail::ForcingsEngineStorage
: shared storage between data providers.detail::assert_forcings_engine_requirements
: helper for ensuring runtime dependencies are available.detail::parse_time
: helper for parsing timestamp strings.constexpr
constants for default time format string and forcings engine python information.Changes
NullForcingProvider
: split implementation into header/source file.GenericDataProvider
: converted into type alias.Checklist