From 4c71083c08f0814902390872523f91911bf4f5ef Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Fri, 22 Jul 2022 06:19:47 +0200 Subject: [PATCH 1/3] PSM3 leap_day=True --- pvlib/iotools/psm3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/iotools/psm3.py b/pvlib/iotools/psm3.py index a8f9781c22..909d850bac 100644 --- a/pvlib/iotools/psm3.py +++ b/pvlib/iotools/psm3.py @@ -42,7 +42,7 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, - attributes=ATTRIBUTES, leap_day=False, full_name=PVLIB_PYTHON, + attributes=ATTRIBUTES, leap_day=True, full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON, map_variables=None, timeout=30): """ Retrieve NSRDB PSM3 timeseries weather data from the PSM3 API. The NSRDB @@ -75,7 +75,7 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, ``pvlib.iotools.psm3.ATTRIBUTES``. See references [2]_, [3]_, and [4]_ for lists of available fields. Alternatively, pvlib names may also be used (e.g. 'ghi' rather than 'GHI'); see :const:`VARIABLE_MAP`. - leap_day : boolean, default False + leap_day : boolean, default: True include leap day in the results. Only used for single-year requests (i.e., it is ignored for tmy/tgy/tdy requests). full_name : str, default 'pvlib python' From 20516ea7f5c9a3c587a361817b84de5ed7731b28 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Fri, 22 Jul 2022 07:47:12 +0200 Subject: [PATCH 2/3] Minor formatting change --- pvlib/tests/iotools/test_psm3.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pvlib/tests/iotools/test_psm3.py b/pvlib/tests/iotools/test_psm3.py index d151cfa6da..c35aea5c53 100644 --- a/pvlib/tests/iotools/test_psm3.py +++ b/pvlib/tests/iotools/test_psm3.py @@ -124,9 +124,7 @@ def test_get_psm3_check_leap_day(nrel_api_key): ]) @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_psm3_tmy_errors( - latitude, longitude, api_key, names, interval -): +def test_get_psm3_tmy_errors(latitude, longitude, api_key, names, interval): """Test get_psm3() for multiple erroneous input scenarios. These scenarios include: From f3bc893bcebf18ebec8e55bab239e2a97fbc0cfa Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:24:44 +0200 Subject: [PATCH 3/3] Remove deprecation warning --- pvlib/iotools/psm3.py | 8 -------- pvlib/tests/iotools/test_psm3.py | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/pvlib/iotools/psm3.py b/pvlib/iotools/psm3.py index 997d6a48d1..909d850bac 100644 --- a/pvlib/iotools/psm3.py +++ b/pvlib/iotools/psm3.py @@ -165,14 +165,6 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, attributes = [amap.get(a, a) for a in attributes] attributes = list(set(attributes)) # remove duplicate values - if (leap_day is None) and (not names.startswith('t')): - warnings.warn( - 'The ``get_psm3`` function will default to leap_day=True ' - 'starting in pvlib 0.11.0. Specify leap_day=True ' - 'to enable this behavior now, or specify leap_day=False ' - 'to hide this warning.', pvlibDeprecationWarning) - leap_day = False - # required query-string parameters for request to PSM3 API params = { 'api_key': api_key, diff --git a/pvlib/tests/iotools/test_psm3.py b/pvlib/tests/iotools/test_psm3.py index a51cc2096a..e9a99ab181 100644 --- a/pvlib/tests/iotools/test_psm3.py +++ b/pvlib/tests/iotools/test_psm3.py @@ -199,14 +199,3 @@ def test_get_psm3_attribute_mapping(nrel_api_key): def test_psm3_variable_map_deprecation_warning(nrel_api_key): with pytest.warns(pvlibDeprecationWarning, match='names will be renamed'): _ = psm3.read_psm3(MANUAL_TEST_DATA) - - -@pytest.mark.remote_data -@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_psm3_leap_day_deprecation_warning(nrel_api_key): - with pytest.warns(pvlibDeprecationWarning, - match='default to leap_day=True'): - _, _ = psm3.get_psm3(LATITUDE, LONGITUDE, nrel_api_key, PVLIB_EMAIL, - names=2019, interval=60, - attributes=['ghi', 'wind_speed'], - map_variables=True)