diff --git a/docs/sphinx/source/whatsnew/v0.11.0.rst b/docs/sphinx/source/whatsnew/v0.11.0.rst index 22d6046774..37cbad3bf9 100644 --- a/docs/sphinx/source/whatsnew/v0.11.0.rst +++ b/docs/sphinx/source/whatsnew/v0.11.0.rst @@ -9,6 +9,8 @@ Breaking changes ~~~~~~~~~~~~~~~~ * The deprecated ``pvlib.modelchain.basic_chain`` has now been removed. (:pull:`1862`) * Remove the `poa_horizontal_ratio` function and all of its references. (:issue:`1697`, :pull:`2021`) +* The `leap_day` parameter in :py:func:`~pvlib.iotools.get_psm3` + now defaults to True instead of False. (:issue:`1481`, :pull:`1991`) Deprecations diff --git a/pvlib/iotools/psm3.py b/pvlib/iotools/psm3.py index 35fb2d362b..35141e3593 100644 --- a/pvlib/iotools/psm3.py +++ b/pvlib/iotools/psm3.py @@ -62,7 +62,7 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, - attributes=ATTRIBUTES, leap_day=None, full_name=PVLIB_PYTHON, + attributes=ATTRIBUTES, leap_day=True, full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON, map_variables=None, url=None, timeout=30): """ @@ -105,7 +105,7 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, for lists of available fields. Alternatively, pvlib names may also be used (e.g. 'ghi' rather than 'GHI'); see :const:`REQUEST_VARIABLE_MAP`. To retrieve all available fields, set ``attributes=[]``. - 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' @@ -179,14 +179,6 @@ def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, # convert pvlib names in attributes to psm3 convention attributes = [REQUEST_VARIABLE_MAP.get(a, a) for a in attributes] - 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 91bba7a830..cde88af851 100644 --- a/pvlib/tests/iotools/test_psm3.py +++ b/pvlib/tests/iotools/test_psm3.py @@ -203,14 +203,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)