-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ForecastModel.set_query_latlon provides arguments in the wrong order to query.lonlat_box. Longitude should precede latitude. #521
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
Comments
Thanks @grisaitis. I agree that the The rest of the Also note that |
@wholmgren Let's fix, it looks to be a small change. |
After hearing what you said, @wholmgren, I think it actually makes sense to remove, not fix, this mention of Proposal: remove this reference to Or feel free to still accept my PR :) |
Some additional remarks about bbox support and ForecastModel: I tried implementing bounding box support myself but gave up and just wrote my own script using siphon to get the data I needed. I borrowed a lot from ForecastModel -- constructing the query, converting the NCSS dataset to a DataFrame, etc -- but it was clear to me that too many changes were needed with ForecastModel to make it all work:
Related note: I think ForecastModel should be broken up into a few collaborators. E.g., converting raw data to processed data could be in another module entirely; why does it need to know that the data came from a NetCDFSubset? Also, instead of subclassing, it would be great to be able to instantiate ForecastModel with (a) a siphon NCSSDataset object and (b) a dict of variable name mappings. This would enable users to use other THREDDS servers, e.g. the GFS historical archive at UCAR . Not sure if there's an issue open about this but it could be pretty useful for some people. |
@grisaitis thanks for the detailed report. I agree that ForecastModel should be broken up and simplified. I would like to retain the simplicity of obtaining and processing data for points, but otherwise I have no particular thoughts about what it should look like. Your proposal sounds reasonable. |
Thanks, @wholmgren. I think the API is great, and in fact useful if we want to offer the option of overriding certain built-in behavior like connecting to the latest GFS model, for instance. I'll open a separate issue about bbox logic. Any refactoring of ForecastModel can be implemented as part of that. How about I change my PR to remove |
I'd suggest we leave the method name alone. It takes no arguments so there is nothing to gain from an API consistency perspective. Let's go ahead and make the simple fix as first proposed. After that we can deal with a larger refactor to clean up the API and support gridded data. As I mentioned on the linked PR, the PR will need to be pointed to I've considered migrating the forecast fetching code to a |
@wholmgren fyi -- fixed the PR base branch. Thanks for heads up about |
Describe the bug
Forecast.set_query_latlon provides arguments in the wrong order to query.lonlat_box. Longitude should precede latitude.
To Reproduce
returns
Expected behavior
and this becomes an issue with GET requests when
get_data
is called...&west=-80&east=350&south=-80&north=80
Versions:
pvlib.__version__
:0.5.2
pandas.__version__
:0.23.0
Python 3.6.5 :: Anaconda, Inc.
The text was updated successfully, but these errors were encountered: