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

[1pt] PR: fixed bug in aggregate_by_huc.py #1404

Merged
merged 9 commits into from
Jan 31, 2025
Merged

Conversation

ZahraGhahremani
Copy link
Contributor

@ZahraGhahremani ZahraGhahremani commented Jan 16, 2025

This PR resolves warnings when running aggregate_by_huc.py with the bridge_flag option. The warnings happened because the GeoPandas read_file method does not support a dtype argument when reading GeoPackages. This PR also, modifies aggregate_by_huc.py to set the CRS for osm_bridge_points.gpkg. It will only set the CRS if the file does not already have a CRS defined.

Changes

- src/aggregate_by_huc.py: Apply specific data types after reading the file and set a CRS for osm_bridge_points.gpkg.

Testing

While addressing this bug, I tested this feature branch to ensure that no osm_ids are missing (PR #1360).

Deployment Plan (For developer use)

How does the changes affect the product?

  • Code only?
  • If applicable, has a deployment plan be created with the deployment person/team?
  • Require new or adjusted data inputs? Does it have start, end and duration code (in UTC)?
  • If new or updated data sets, has the FIM code been updated and tested with the new/adjusted data (subset is fine, but must be a subset of the new data)?
  • Require new pre-clip set?
  • Has new or updated python packages?

Issuer Checklist (For developer use)

You may update this checklist before and/or after creating the PR. If you're unsure about any of them, please ask, we're here to help! These items are what we are going to look for before merging your code.

  • Informative and human-readable title, using the format: [_pt] PR: <description>
  • Links are provided if this PR resolves an issue, or depends on another other PR
  • If submitting a PR to the dev branch (the default branch), you have a descriptive Feature Branch name using the format: dev-<description-of-change> (e.g. dev-revise-levee-masking)
  • Changes are limited to a single goal (no scope creep)
  • The feature branch you're submitting as a PR is up to date (merged) with the latest dev branch
  • pre-commit hooks were run locally
  • 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
  • CHANGELOG updated with template version number, e.g. 4.x.x.x
  • Add yourself as an assignee in the PR as well as the FIM Technical Lead

Merge Checklist (For Technical Lead use only)

  • Update CHANGELOG with latest version number and merge date
  • Update the Citation.cff file to reflect the latest version number in the CHANGELOG
  • If applicable, update README with major alterations

@ZahraGhahremani ZahraGhahremani changed the title fixed bug in aggregate_by_huc.py [1pt] PR: fixed bug in aggregate_by_huc.py Jan 16, 2025
@ZahraGhahremani ZahraGhahremani added bug Something isn't working Med Priority labels Jan 16, 2025
@RobHanna-NOAA
Copy link
Contributor

I saw your fix for agg_by_huc.. but what if it is AK coming in?

@ZahraGhahremani ZahraGhahremani marked this pull request as ready for review January 27, 2025 21:07
Copy link
Collaborator

@AliForghani-NOAA AliForghani-NOAA left a comment

Choose a reason for hiding this comment

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

The code was tested on a CONUS HUC8 and successfully generated an aggregated osm_bridge_centroids.gpkg file with a defined CRS (EPSG:5070).

@CarsonPruitt-NOAA CarsonPruitt-NOAA merged commit 662bdb5 into dev Jan 31, 2025
1 check passed
@CarsonPruitt-NOAA CarsonPruitt-NOAA deleted the dev-fix-bug branch January 31, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants