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

Ngen fixes #592

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

Ngen fixes #592

wants to merge 3 commits into from

Conversation

hellkite500
Copy link
Member

A couple fixes on hy_features network with relation to handling terminal links and qlateral flows, and (another) fix in the validation logic for the length of qlats. These changes were tested on the ngen branch and ported over here to keep these classes in sync as much as possible between the branches until we get a main on the master branch.

Additions

Removals

Changes

  • Use a set of upstream terminal nexuses, and pick only one to add qlat to.
  • validate qlat inputs in mc_reach incorpporating qts_subdivisions

Testing

  1. Tested via ngen calibration excercises

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
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Target Environment support

  • Linux
  • MacOW

@mattw-nws
Copy link
Contributor

mattw-nws commented Nov 4, 2022

@hellkite500 Per discussion, I think this fixes one or more of #581 , #582 , and #583 ? Can you comment on which?

if qlat_values.shape[1] < nsteps:
raise ValueError(f"Number of columns (timesteps) in Qlat is incorrect: expected at most ({data_idx.shape[0]}), got ({qlat_values.shape[1]}). The number of columns in Qlat must be equal to or less than the number of routing timesteps")
if qlat_values.shape[1] < nsteps/qts_subdivisions:
raise ValueError(f"Number of columns (timesteps) in Qlat is incorrect: expected at least ({data_idx.shape[1]/(nsteps/qts_subdivisions)}), got ({qlat_values.shape[1]}). The number of columns in Qlat must be at least the number of routing timesteps")
Copy link
Contributor

Choose a reason for hiding this comment

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

qts_subdivisions in Line 225 should be equal to dt_qlat / dt, where dt_qlat and dt are lateral flow data time interval and channel routing time interval, respectively.

#but it isn't clear right now how to do that with flow/velocity/depth requirements
#find the terminal nodes
for tnx, up in terminal_links.items():
print(up, tnx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this print supposed to be here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only if you like non-contextual debugging information.

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

5 participants