From 66b90002864d039f75dded9713ac25250800b5a9 Mon Sep 17 00:00:00 2001 From: YoannUniKS <68388128+YoannUniKS@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:29:26 +0200 Subject: [PATCH 1/2] Corrected future warning in solarposition.py - corrected code to avoid: casting datetime64[ns, Europe/Berlin] values to int64 with .astype(...) is deprecated and will raise in a future version. Use .view(...) instead. --- pvlib/solarposition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 040f9d5f14..9f7a77a526 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -365,7 +365,7 @@ def spa_python(time, latitude, longitude, except (TypeError, ValueError): time = pd.DatetimeIndex([time, ]) - unixtime = np.array(time.astype(np.int64)/10**9) + unixtime = np.array(time.view(np.int64)/10**9) spa = _spa_python_import(how) From afcdffdfe0d387e03132e441a5993ffe1359bc91 Mon Sep 17 00:00:00 2001 From: YoannUniKS <68388128+YoannUniKS@users.noreply.github.com> Date: Mon, 12 Jul 2021 11:20:56 +0200 Subject: [PATCH 2/2] Update v0.9.0.rst --- docs/sphinx/source/whatsnew/v0.9.0.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.9.0.rst b/docs/sphinx/source/whatsnew/v0.9.0.rst index 80dab7dc23..b5b1d4e52f 100644 --- a/docs/sphinx/source/whatsnew/v0.9.0.rst +++ b/docs/sphinx/source/whatsnew/v0.9.0.rst @@ -175,6 +175,7 @@ Bug fixes * Corrected an error affecting :py:func:`~pvlib.clearsky.detect_clearsky` when data time step is not one minute. Error was introduced in v0.8.1. (:issue:`1241`, :pull:`1242`) +* Corrected :py:func:`~pvlib.solarposition.spa_python` to avoid a future warning. (:pull:`1256`) Testing ~~~~~~~ @@ -212,3 +213,4 @@ Contributors * Miguel Sánchez de León Peque (:ghuser:`Peque`) * Joe Ranalli (:ghuser:`jranalli`) * Chas Schweizer (:ghuser:`cpr-chas`) +* Yoann Louvet (:ghuser:`YoannUniKS`)