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

Updates to handle problematic waterbody data #764

Merged

Conversation

shorvath-noaa
Copy link
Contributor

Two major updates:

  1. Fix issue of duplicate integer IDs between some waterbodies and stream segments. We now add a large number to any duplicate waterbody ID initially, then revert back to the original ID before writing output files.
  2. Some waterbodies have flowpaths that physically lie within them, but are not referenced to the waterbody ID. This causes issues when collapsing segment IDs into a single waterbody ID in our connections dictionary (multiple "downstream" IDs which violates the DAG). These waterbodies are simply "dropped" as waterbodies, meaning the underlying segments are used for MC routing.

Additions

Removals

Changes

AbstractRouting.py

  • Updates to finding outlet IDs of waterbodies. The old method became an issue for a waterbody in Florida that directly flows into the ocean.

HYFeaturesNetwork.py

  • Update to bandaid() function to simply drop problematic waterbody IDs.
  • Change fix for duplicate IDs. Old method added a large value to flowpath IDs, now it adds to waterbody IDs.
  • Saves the duplicate_ids crosswalk dictionary to revert changes before producing output.

output.py

  • Reverts duplicate ID changes.

main.py

  • Passes duplicate_ids dictionary to output generator function.

Testing

  1. Successfully ran a dummy (unrealistic forcing inputs) CONUS run with waterbodies enabled.
  2. Verified output files contain original IDs.

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

@shorvath-noaa shorvath-noaa merged commit 692d28a into NOAA-OWP:master May 2, 2024
4 checks passed
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