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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary (and potentially erroneous) calls when no lakes are present. #750

Closed
wants to merge 1 commit into from

Conversation

JurgenZach-NOAA
Copy link
Contributor

Primarily, this PR is to address erroneous behavior that appeared if t-route did not find any lakes in a given geopackage (as is, for example, the case in the coastal bayous in Texas). Secondarily, unnecessary function calls were also avoided for such cases.

Additions

  • If statements in HYFeaturesNetwork.py, DataAssimilation.py, compute.py

Removals

Changes

Testing

  1. Running, e.g., Cedar Bayou with reservoir DA enabled.

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

@JurgenZach-NOAA JurgenZach-NOAA self-assigned this Mar 4, 2024
Copy link
Contributor

@shorvath-noaa shorvath-noaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this goal can be accomplished with only changes to HYFeatureNetwork.py. I believe, based on the most up-to-date master branch, that the only change needed is to check that at least 1 waterbody ID in self.waterbody_dataframe is found in self.dataframe['waterbody']. This should be done early on in the function self.preprocess_waterbodies(). If that is true, business as usual. If it is untrue (there are no waterbody IDs in self.waterbody_dataframe that are also in self.dataframe['waterbody']), then t-route changes any parameters necessary (think break_network_at_waterbodies, persistence_da, rfc_da, ...) accordingly and skips the rest of the steps in self.preprocess_waterbodies() and just performs the else: statements found here.

@JurgenZach-NOAA
Copy link
Contributor Author

Due to the fact that this PR was in the queue since March, it's easier to start a new one than try to fix this one.

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.

2 participants