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

[#135] NLDI data retrieval #136

Merged
merged 10 commits into from
Apr 28, 2024

Conversation

pkdash
Copy link
Contributor

@pkdash pkdash commented Mar 8, 2024

Created this draft PR to get some early feedback.

This is a draft implementation of 2 functions for accessing NLDI.
This implementation adds a new dependency - geopandas
NLDI API documentation does not help much in terms of implementing validation for input parameters.
The parameters of the 2 functions that I have implemented probably need more accurate description to make it user friendly.

@thodson-usgs
Copy link
Collaborator

😮

gdf = gpd.GeoDataFrame.from_features(feature_collection)

...slick. Thank you for showing me that one.

Before the final merge, I want to check the size of the dependencies with GeoPandas, and we might discuss with Jeff whether to make it an optional dependency. A nice feature of dataretrieval is that our dependencies are small enough to deploy on Lambda.

Looks great so far.

@pkdash
Copy link
Contributor Author

pkdash commented Mar 12, 2024

@thodson-usgs I like the idea of making the GeoPandas as optional dependency. I am going to implement the remaining NLDI data retrieval functions.

@thodson-usgs
Copy link
Collaborator

@pkdash, did you run out of time? Should I pick this up?

@pkdash
Copy link
Contributor Author

pkdash commented Apr 10, 2024

@thodson-usgs Thanks for checking. Yeah has been busy with other projects. I will try to finish it next week. If I can't get to it next week, you can pick this up. I will let you know.

@thodson-usgs
Copy link
Collaborator

Ah sorry! I'm too used to relying on CI. I should've tested before mucking up your PR. Stand by

@thodson-usgs
Copy link
Collaborator

@pkdash, I tweaked the CI and build pipeline. I might also tweak how we handle geopandas as an optional dependency.
Otherwise, these changes are looking good so far. Is this PR ready or still draft?

@pkdash
Copy link
Contributor Author

pkdash commented Apr 22, 2024

@thodson-usgs The only thing left is handling of the geopandas as optional dependency. I ran out of time yesterday. If you can take care of that then the PR is ready. Thanks.

@thodson-usgs thodson-usgs marked this pull request as ready for review April 28, 2024 16:00
@thodson-usgs thodson-usgs self-requested a review April 28, 2024 16:01
Copy link
Collaborator

@thodson-usgs thodson-usgs left a comment

Choose a reason for hiding this comment

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

Great work @pkdash! I think I will ultimately rewrite search, but otherwise this PR looks good to go.

return gdf


def search(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I intend search to be a lower-level function to return a nested dict of multiple feature types. For example, if we wanted to get multiple features upstream of a site, this would allow us to accomplish that in a single API call. Nevertheless, I'm fine with this for the first cut. Great work!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to my lack of understanding of the domain, I was struggling a bit to implement the search functionality.

@thodson-usgs thodson-usgs merged commit 786e811 into DOI-USGS:master Apr 28, 2024
8 of 9 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