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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

BMI prototype for Hyfeature network #598

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kumdonoaa
Copy link
Contributor

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

  1. In t-route/test/unit_test_hyfeature/
    python3 run-troute-with-bmi.py

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 馃憞)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool 鉃★笍

Testing checklist

Target Environment support

  • Windows
  • Linux
  • Browser

Accessibility

  • Keyboard friendly
  • Screen reader friendly

Other

  • Is useable without CSS
  • Is useable without JS
  • Flexible from small to large screens
  • No linting errors or warnings
  • JavaScript tests are passing
  • [ ]


# -------------- 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()):
Copy link
Contributor

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)
Copy link
Contributor

@groutr groutr Dec 9, 2022

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))
Copy link
Contributor

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."""
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants