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

3 parameters are added to return usgs observed values, calculated flo… #639

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

Conversation

AminTorabi-NOAA
Copy link
Contributor

@AminTorabi-NOAA AminTorabi-NOAA commented Aug 22, 2023

In this code revision, several key changes were implemented to enhance the readability and organization of the original code. These changes are summarized as follows:

1- Lists Introduced: Three empty lists (usgs_values_list, flowveldepth_list, and da_buf0_list) were introduced to systematically store values extracted from the corresponding NumPy arrays.

2- Data Appending: Values from usgs_values (which is observed flowrate), flowveldepth (include calculated flow rate), and da_buf[0] (it's a data assimilated flowrate) were appended to their respective lists. This process organizes and captures specific data points.

3- List to Array Conversion: After the loop, the lists were converted into NumPy arrays using np.array(). This step transforms the collected data into arrays for easier manipulation and analysis.

4- Final Arrays: The resulting arrays (usgs_values_observed, flowveldepth_calculated, and da_buf0_array) now contain the actual values extracted from the original arrays during the loop iteration. These arrays are ready for further processing or analysis.

5- reordered the return values to improve the readability

These modifications were made with the intention of improving code organization, enhancing readability, and enabling easier access to specific data points from the original arrays. The revised code structure is designed to facilitate data extraction and subsequent analysis, making it more efficient and maintainable.

Additions

3 returned item including: usgs_values_observed, flowveldepth_calculated, and da_buf0_array

Removals

Changes

  • Return values have reordered to be more readable.

Testing

  1. t-route need to be recompile, and tested on Lowercolorado example.

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

…wveldepth and assimilated. The values are arrays

if timestep < flowveldepth.shape[1]:
flowveldepth_value = flowveldepth[usgs_position_i, timestep]
flowveldepth_list.append(flowveldepth_value)
Copy link
Contributor

Choose a reason for hiding this comment

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

For clarity, flowveldepth_value can be replaced by model_flow_value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted flowveldepth, Sean mentioned its one of the main returns and we don't need to return it again.

src/troute-routing/troute/routing/fast_reach/mc_reach.pyx Outdated Show resolved Hide resolved
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