From 174d2143a3a7d449992afa2d50d73c50bbf61d86 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:47:46 +0200 Subject: [PATCH 1/2] Change input oder --- pvlib/iotools/psm3.py | 8 ++++---- pvlib/iotools/pvgis.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pvlib/iotools/psm3.py b/pvlib/iotools/psm3.py index 7b3363e0a8..25c444a91e 100644 --- a/pvlib/iotools/psm3.py +++ b/pvlib/iotools/psm3.py @@ -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 @@ -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 diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py index cdb7e63389..da238898a8 100644 --- a/pvlib/iotools/pvgis.py +++ b/pvlib/iotools/pvgis.py @@ -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. @@ -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 From d6c25efcada6d0b37d58e383c8399d2fce9e044f Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Fri, 30 Jun 2023 15:17:58 -0400 Subject: [PATCH 2/2] whatsnew --- docs/sphinx/source/whatsnew/v0.10.0.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.10.0.rst b/docs/sphinx/source/whatsnew/v0.10.0.rst index 18503f82d9..1e04c54bb0 100644 --- a/docs/sphinx/source/whatsnew/v0.10.0.rst +++ b/docs/sphinx/source/whatsnew/v0.10.0.rst @@ -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 ~~~~~~~~~~~~