-
Notifications
You must be signed in to change notification settings - Fork 9
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
Adapt COOPS to have an IOC-like API #99
Comments
Partially addressed in #123 |
With the new metadata API implemented in #123, one needs to use the From @AtiehAlipour-NOAA
|
@pmav99 as I started working on this, I realized that there are some limitations on the combination of products, data length and data interval in the web API. These are documented in: https://api.tidesandcurrents.noaa.gov/api/prod/ at different sections. Sometimes these incompatibilities are just ignored by the web API and the default is returned (e.g. for Do you think it's reasonable to account for all of this in |
@pmav99 apart from the error issue above, what's your vision for the unified API? I mean IOC accepts |
@SorooshMani-NOAA go with start/end dates. For the IOC I was even thinking of something that would allow to have a different start/end date for each station. I don't think that different end dates is that useful, but the start_date can be useful when you are scraping data and a station goes down:
But that's just a thought. I am happy to hear your thoughts. |
If the API throws an error, I guess that we should also throw an Exception. |
As we discussed in the meeting, we're going to unify/standardize how searvey's IOC (using IOC API) and COOPS work, with better arguments (e.g. I'll wait for the new branch for IOC to be created and then will work on COOPS updates based on that. Other relevant highlights from the meeting for new API:
|
Related to #126 |
I will need to work on better documentation and updating notebooks |
@pmav99 can you please share the code you were using to get multiple stations using the new API? I'd like to add it as an example in the coops notebook. |
station_ids = ["abas", "acaj", "acap2"]
start_dates = pd.DatetimeIndex(["2023"] * len(station_ids))
end_dates = pd.DatetimeIndex(["2024"] * len(station_ids))
ioc._fetch_ioc(
station_ids=station_ids,
start_dates=start_dates,
end_dates=end_dates,
rate_limit=None,
http_client=None,
multiprocessing_executor=None,
multithreading_executor=None
) and it returns a dictionary of dataframes. |
Thanks, I remember we discussed this, but I don't recall what was the outcome: |
I would just stick with one station for now. After all, you can get the same functionality with a for loop. Let's discuss this on the meeting too. |
We'd like to have an standardized API for all the station data. Also we'd like to make sure all the possible queries through
searvey
are successful assuming the server gives a correct response (e.g. vector data).To this end as we discussed we'll start adding a parallel API for coops stations and explore what parts of the current API stays relevant to be kept.
stormevents
relies on COOPS module, so it's a good test case for keeping compatibility to the old API as much as possible during this developmentThe text was updated successfully, but these errors were encountered: