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

Expand site info metadata (addresses #73) #74

Merged
merged 3 commits into from
Dec 23, 2022

Conversation

elbeejay
Copy link
Contributor

@elbeejay elbeejay commented Dec 23, 2022

This PR closes #73 and fixes bug with countyCd queries.


Specifically the following changes are proposed:

  • Allows water service queries (query_waterservices) to be called with only the countyCd being specified, previously this was not allowed and made it impossible? to do a county query. Alters error message to match expanded behavior.
  • Expands the _set_metadata function to allow the lambda function assigned to the site_info attribute of the metadata object to be set by parameters other than only sites and site_no
  • Adds tests of this expanded _set_metadata functionality that do not execute any queries but check that the lambda functions behind metadata.site_info are set up
  • Relaxes metadata check for site_info in waterservices_test.py as the site_info attribute can now be set by more parameters

if alias in parameters:
md.site_info = lambda: what_sites(sites=parameters[alias])
break
# site_no is preferred over sites to set site_info if both are present,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part feels a little kludgy, but I'd have to think more about how we improve it.

@thodson-usgs thodson-usgs merged commit 0d743fe into DOI-USGS:master Dec 23, 2022
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.

site_info metadata for queries with stateCd, huc, or bBox
2 participants