Skip to content

Commit 4ac847f

Browse files
Change input order of map_variables and url (#1795)
* Change input oder * whatsnew --------- Co-authored-by: Kevin Anderson <[email protected]>
1 parent 9be4487 commit 4ac847f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

docs/sphinx/source/whatsnew/v0.10.0.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Breaking changes
1919
* :func:`~pvlib.iotools.get_pvgis_tmy` and :func:`~pvlib.iotools.read_pvgis_tmy`
2020
now rename columns to standard pvlib names by default (``map_variables=True``)
2121
(:pull:`1772`)
22+
* In :py:func:`~pvlib.iotools.get_pvgis_tmy`, the ``map_variables`` keyword
23+
parameter now comes before the ``url`` keyword parameter. (:pull:`1795`)
24+
2225

2326
Deprecations
2427
~~~~~~~~~~~~

pvlib/iotools/psm3.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60,
6565
attributes=ATTRIBUTES, leap_day=None, full_name=PVLIB_PYTHON,
66-
affiliation=PVLIB_PYTHON, url=None, map_variables=None,
66+
affiliation=PVLIB_PYTHON, map_variables=None, url=None,
6767
timeout=30):
6868
"""
6969
Retrieve NSRDB PSM3 timeseries weather data from the PSM3 API. The NSRDB
@@ -112,12 +112,12 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60,
112112
optional
113113
affiliation : str, default 'pvlib python'
114114
optional
115-
url : str, optional
116-
API endpoint URL. If not specified, the endpoint is determined from
117-
the ``names`` and ``interval`` parameters.
118115
map_variables : boolean, optional
119116
When true, renames columns of the Dataframe to pvlib variable names
120117
where applicable. See variable :const:`VARIABLE_MAP`.
118+
url : str, optional
119+
API endpoint URL. If not specified, the endpoint is determined from
120+
the ``names`` and ``interval`` parameters.
121121
timeout : int, default 30
122122
time in seconds to wait for server response before timeout
123123

pvlib/iotools/pvgis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
391391

392392

393393
def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
394-
userhorizon=None, startyear=None, endyear=None, url=URL,
395-
map_variables=True, timeout=30):
394+
userhorizon=None, startyear=None, endyear=None,
395+
map_variables=True, url=URL, timeout=30):
396396
"""
397397
Get TMY data from PVGIS.
398398
@@ -418,11 +418,11 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
418418
first year to calculate TMY
419419
endyear : int, default None
420420
last year to calculate TMY, must be at least 10 years from first year
421-
url : str, default: :const:`pvlib.iotools.pvgis.URL`
422-
base url of PVGIS API, append ``tmy`` to get TMY endpoint
423421
map_variables: bool, default True
424422
When true, renames columns of the Dataframe to pvlib variable names
425423
where applicable. See variable :const:`VARIABLE_MAP`.
424+
url : str, default: :const:`pvlib.iotools.pvgis.URL`
425+
base url of PVGIS API, append ``tmy`` to get TMY endpoint
426426
timeout : int, default 30
427427
time in seconds to wait for server response before timeout
428428

0 commit comments

Comments
 (0)