Skip to content

Change input order of map_variables and url #1795

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

Merged
merged 2 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for posterity: url is new in get_psm3 in this version (#1736), so this isn't a change relative to 0.9.5

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