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

Read json/geojson files #699

Merged
merged 4 commits into from
Nov 15, 2023
Merged

Conversation

shorvath-noaa
Copy link
Contributor

@shorvath-noaa shorvath-noaa commented Nov 15, 2023

Added ability for t-route to read network information from json and geojson files. These changes have only been implemented for input files that contain network and nexus information, not waterbody or data assimilation info.

Additions

config.py

  • Added @root_validator to check if the .yaml file contains a .json file for flowpath_edge_list if the geo_file_path is a .json file.

Removals

Changes

network_topology_parameters.py

  • Made waterbody:, alt:, and gages: parameters under columns: optional
  • Added optional flowpath_edge_list: parameter

HYFeaturesNetwork.py

  • Updated read_json() function to be flexible in handling the names of id and toid
  • Added read_geojson() function
  • Updated read_geo_file() function to choose between reading .gpkg, .json, or .geojson files
  • Moved renaming of self._dataframe columns to before any other dataframe manipulation happens

Testing

  1. Tested on sample geojson and json input files.
  2. Tested on existing geopackage file.

Screenshots

Notes

  • This will work if running channel routing only (no reservoir routing or data assimilation). A new PR can be made if these features are needed.

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

@AminTorabi-NOAA
Copy link
Contributor

@shorvath-noaa I encountered an issue while running 'LoweColorado_TX_v4.' It appears to give an error because there is no folder named 'lakeout.' Would it be possible for you to add a 'lakeout' folder to 'LoweColorado_TX_v4'?

@shorvath-noaa
Copy link
Contributor Author

@AminTorabi-NOAA I added those directories

@shorvath-noaa shorvath-noaa merged commit d1002e6 into NOAA-OWP:master Nov 15, 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