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

try-except method to handle new hydrofabric layer names #814

Closed

Conversation

shorvath-noaa
Copy link
Contributor

Newer versions of the hydrofabric have different layer names than older versions. These changes are currently:

  • Older versions -> new version
    • flowpaths -> flowlines
    • flowpath_attributes -> flowpath-attributes

This PR adds a try-except check when reading the geopackage to handle either the new names or the old names. It first tries to read the new layer names, then reverts to the old names if a ValueError exception is raised.

Additions

HYFeaturesNetwork.py

  • gpd_read_file() function. Basically just gpd.read_file() but with a try-except wrapper.
  • former_layer_names dictionary mapping the new names to the old names.

Removals

Changes

  • Defaults to use new names.

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

@shorvath-noaa shorvath-noaa deleted the new_hydrofabric_table_names branch August 14, 2024 19:38
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.

1 participant