-
Notifications
You must be signed in to change notification settings - Fork 51
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
BMI prototype for Hyfeature network #598
base: master
Are you sure you want to change the base?
Conversation
|
||
# -------------- Initalize all the variables --------------------------# | ||
# -------------- so that they'll be picked up with the get functions --# | ||
for var_name in list(self._var_name_units_map.keys()): |
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.
Creating a list here is unnecessary. The keys can be iterated thru directly.
for var_name in self._var_nname_units_map:
int | ||
Rank of grid. | ||
""" | ||
return len(self._model.shape) |
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 self._model is a numpy array, we can simply return self._model.ndim
int | ||
Size of grid. | ||
""" | ||
return int(np.prod(self._model.shape)) |
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 self._model is a numpy array, we can return self._model.size
return self._name | ||
|
||
def get_input_item_count(self): | ||
"""Get names of input variables.""" |
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.
Docstring doesn't make sense here.
A prototype of wrapping BMI around t-route with Hyfeature networks is produced here. So far, BMI around initialize and set_value functions were successfully made. The initialize function prepares channel network connectivity and config file parameter values. Also, it prepares sets of forcing files and sets of TimeSlice files for each time loop and sets of CHRTOUT files against which to compare t-route flows. Finally, it coverts lateral flow dataframe into one element of BMI dictionary data.
** This is only a prototype (not to be merged yet) and more updates yet to come.
Additions
Removals
Changes
Testing
python3 run-troute-with-bmi.py
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other