Skip to content

Commit

Permalink
Change input order of map_variables and url (#1795)
Browse files Browse the repository at this point in the history
* Change input oder

* whatsnew

---------

Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
  • Loading branch information
AdamRJensen and kandersolar committed Jun 30, 2023
1 parent 9be4487 commit 4ac847f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.10.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Breaking changes
* :func:`~pvlib.iotools.get_pvgis_tmy` and :func:`~pvlib.iotools.read_pvgis_tmy`
now rename columns to standard pvlib names by default (``map_variables=True``)
(:pull:`1772`)
* In :py:func:`~pvlib.iotools.get_pvgis_tmy`, the ``map_variables`` keyword
parameter now comes before the ``url`` keyword parameter. (:pull:`1795`)


Deprecations
~~~~~~~~~~~~
Expand Down
8 changes: 4 additions & 4 deletions pvlib/iotools/psm3.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60,
attributes=ATTRIBUTES, leap_day=None, full_name=PVLIB_PYTHON,
affiliation=PVLIB_PYTHON, url=None, map_variables=None,
affiliation=PVLIB_PYTHON, map_variables=None, url=None,
timeout=30):
"""
Retrieve NSRDB PSM3 timeseries weather data from the PSM3 API. The NSRDB
Expand Down Expand Up @@ -112,12 +112,12 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60,
optional
affiliation : str, default 'pvlib python'
optional
url : str, optional
API endpoint URL. If not specified, the endpoint is determined from
the ``names`` and ``interval`` parameters.
map_variables : boolean, optional
When true, renames columns of the Dataframe to pvlib variable names
where applicable. See variable :const:`VARIABLE_MAP`.
url : str, optional
API endpoint URL. If not specified, the endpoint is determined from
the ``names`` and ``interval`` parameters.
timeout : int, default 30
time in seconds to wait for server response before timeout
Expand Down
8 changes: 4 additions & 4 deletions pvlib/iotools/pvgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):


def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
userhorizon=None, startyear=None, endyear=None, url=URL,
map_variables=True, timeout=30):
userhorizon=None, startyear=None, endyear=None,
map_variables=True, url=URL, timeout=30):
"""
Get TMY data from PVGIS.
Expand All @@ -418,11 +418,11 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
first year to calculate TMY
endyear : int, default None
last year to calculate TMY, must be at least 10 years from first year
url : str, default: :const:`pvlib.iotools.pvgis.URL`
base url of PVGIS API, append ``tmy`` to get TMY endpoint
map_variables: bool, default True
When true, renames columns of the Dataframe to pvlib variable names
where applicable. See variable :const:`VARIABLE_MAP`.
url : str, default: :const:`pvlib.iotools.pvgis.URL`
base url of PVGIS API, append ``tmy`` to get TMY endpoint
timeout : int, default 30
time in seconds to wait for server response before timeout
Expand Down

0 comments on commit 4ac847f

Please sign in to comment.