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

simple fix for flowpaths with unavailable 3Dxsec data #715

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

kumdonoaa
Copy link
Contributor

3D channel cross section data currently being developed for diffusive mainstem domains has missing topobathy data for some flowpaths in the domains. The 3D data is based on v20.1 hydrofabric gpkg. To temporarily fix this issue while waiting for more solid update, a simple solution was applied to fill the gap: Basically, a flowpath with no available topobathy data, it borrows the data from the closest upstream flowpath. If the upstream has multiple topobathy data available, then it borrows the most downstream topobathy data. Again, this is a simple and temporary solution for making diffusive module functionally run and need to be updated along the way.

Additions

Removals

Changes

Testing

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

…e a seperate function to build diffusive_domain with given ids of both ends of mainstem
@@ -325,8 +314,11 @@ def topobathy_df(self):
temp_df.index = new_index
cs_id_max = temp_df['cs_id'].max()
fill_in_topobathy_df = temp_df[temp_df.cs_id==cs_id_max]
fill_in_topobathy_df.cs_id = fill_in_topobathy_df.cs_id.replace(cs_id_max,1)
Copy link
Contributor

Choose a reason for hiding this comment

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

On this line (317) there is a warning that say:

A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
fill_in_topobathy_df.cs_id = fill_in_topobathy_df.cs_id.replace(cs_id_max,1)

to fix this, change line 316 to fill_in_topobathy_df = pd.DataFrame(temp_df[temp_df.cs_id == cs_id_max])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for this update.

@kumdonoaa kumdonoaa merged commit 4cd3e49 into NOAA-OWP:master Dec 20, 2023
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