-
Notifications
You must be signed in to change notification settings - Fork 8
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
Retrieve any forecast layer for arbitrary datetimes #66
Comments
Numpy could be used as a fallback (linear interpolation only) when scipy isn't installed. |
Here's a version that uses numpy instead of scipy. That would be better for use in Home Assistant as numpy is already used by HA core.
|
I'm not sure that we need to interpolate, or at least shouldn't require these as dependencies. This page https://weather-gov.github.io/api/gridpoints |
Hmm, I've always used interpolation but maybe I'm doing it wrong. It's simpler if interpolation is removed. |
However I'm not saying it isn't useful, just that I'm not sure it makes sense to make it a hard dependency for this library. |
There is also the possiblity of allowing it as an optional dependency, which might make sense. Edit: Maybe as simple as having the default be |
Here's another prototype that just uses the ranges.
|
Note that I used datetime.fromisoformat() which is only available in Python 3.7+. But all versions of Python prior to that are no longer supported--https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions |
I've started #67 to formally require >=3.7 |
Thanks Matthew! |
I went ahead and submitted a PR to get things started |
Before you release these changes... I'd like to consider the naming of the new things in this PR.
Perhaps this could be better. Maybe like this:
Future API changes could have the following:
Also, could review the names on the Forecast class:
And finally, consider a better name than "layer" to describe forecast elements. That name is closely coupled to the NWS API. And some of the "layers" could be applicable to "SimpleForecast" if/when that is implemented. Thoughts? |
I like I like the idea of moving towards I don't mind the current method names, but if you have suggestions feel free. For layers, I'm thinking we may want to have a structure like:
Due to these different structure of forecasts and observations, I think we need totally different Enums for each. |
Here's my initial prototype of supporting retrieval of any forecast layer for arbitrary datetimes. The get_forecast_all() method should be changed to return a Forecast instance.
The text was updated successfully, but these errors were encountered: