-
Notifications
You must be signed in to change notification settings - Fork 52
Feature - add support to retrieve flood stages #32
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
Conversation
|
Good proposal, but let's call the new module waterwatch and we can include other WaterWatch data. |
|
WaterWatch won't receive any new features but it will continue to operate. Here are a few of my initial thoughts on how to improve this feature. I'm open to yours
|
|
Good points. Will do the requested changes. My reasoning behind having two separate functions is three-folds: (1) separation of concerns so that the data source can easily be changed in the future without affecting the main function used by the user and (2) also a unit test can be written and (3) giving the user the ability to store all flood stages in memory (e.g. in an interactive environment like a Jupyter notebook) hence reducing the number of HTTP requests needed. What do you think about this? In any case I am happy to change it as per your request. |
|
Any idea if there's an alternative source? Is this maintained by NOAA nowadays? |
|
Ah, I assumed waterwatch allowed multi site queries, but looking at the REST API, it seems to only allow one site or all sites: |
I propose to add support for retrieving flood stages from the water service.
The following retrieves all flood stages in a single call:
all_flood_stages = get_flood_stages()To get the flood stages for a particular site number:
get_flood_stage(site_no=["07144100"])For multiple sites:
stations = ["07144100", "07144101"]print(get_flood_stage(stations)){'07144100': {'action_stage': '20', 'flood_stage': '22', 'moderate_flood_stage': '25', 'major_flood_stage': '26'}, '07144101': None}