Skip to content

ForecastModel.set_query_latlon provides arguments in the wrong order to query.lonlat_box. Longitude should precede latitude.  #521

@grisaitis

Description

@grisaitis

Describe the bug
Forecast.set_query_latlon provides arguments in the wrong order to query.lonlat_box. Longitude should precede latitude.

To Reproduce

from pvlib.forecast import GFS

model = GFS()
model.connect_to_catalog()
model.longitude = [10, 350]
model.latitude = [-80, 80]
model.set_query_latlon()
print(model.query.spatial_query)

returns

OrderedDict([('west', -80), ('east', 80), ('south', 10), ('north', 350)])

Expected behavior

OrderedDict([('west', 10), ('east', 350), ('south', -80), ('north', 80)])

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: Python 3.6.5 :: Anaconda, Inc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions