Repository: pvlib/pvanalytics

Issue:
Tests for clearsky.reno fail with pvlib 0.8.1
PVLib 0.8.1 changed the labeling of clear-sky periods (https://github.com/pvlib/pvlib-python/pull/1074) which is resulting in a test failures in `test_clearsky.py`.

The change in pvlib labels windows on the center by default, while previous behavior labeled on the left. We probably want to accept the new default behavior from PVLib (updating the tests to match) and expose the new `align` parameter in `pvanalytics.clearsky.reno`.

Discussion:

Patch:
diff --git a/docs/whatsnew/0.1.1.rst b/docs/whatsnew/0.1.1.rst
index adfb37a..cf57d3e 100644
--- a/docs/whatsnew/0.1.1.rst
+++ b/docs/whatsnew/0.1.1.rst
@@ -24,6 +24,8 @@ Bug Fixes
 * Prohibit pandas versions in the 1.1.x series to avoid an issue in
   ``.groupby().rolling()``.  Newer versions starting in 1.2.0 and older
   versions going back to 0.24.0 are still allowed. (:issue:`82`, :pull:`118`)
+* Fixed an issue with :py:func:`pvanalytics.features.clearsky.reno` in recent
+  pandas versions (:issue:`125`, :pull:`128`)
 
 Contributors
 ~~~~~~~~~~~~
diff --git a/pvanalytics/features/clearsky.py b/pvanalytics/features/clearsky.py
index e1fc5b0..2554ad8 100644
--- a/pvanalytics/features/clearsky.py
+++ b/pvanalytics/features/clearsky.py
@@ -62,7 +62,7 @@ def reno(ghi, ghi_clearsky):
 
     """
     delta = ghi.index.to_series().diff()
-    delta_minutes = delta[1] / np.timedelta64(1, '60s')
+    delta_minutes = delta[1].total_seconds() / 60
     if delta_minutes > 15:
         raise ValueError('clearsky requires regular time intervals '
                          'of 15m or less')


Test patch:
diff --git a/pvanalytics/tests/features/test_clearsky.py b/pvanalytics/tests/features/test_clearsky.py
index 3e75277..e34a067 100644
--- a/pvanalytics/tests/features/test_clearsky.py
+++ b/pvanalytics/tests/features/test_clearsky.py
@@ -1,10 +1,14 @@
 """Tests for feature labeling functions."""
 import pytest
 import pandas as pd
+import pvlib
 from pvanalytics.features import clearsky
 
+from pkg_resources import parse_version
+is_old_pvlib = parse_version(pvlib.__version__) < parse_version("0.9.0")
 
-@pytest.mark.skip(reason="GH #105")
+
+@pytest.mark.skipif(is_old_pvlib, reason="GH #105")
 @pytest.mark.filterwarnings("ignore:Support for multi-dimensional indexing")
 def test_reno_identical(quadratic):
     """Identical clearsky and measured irradiance all True"""
@@ -14,7 +18,7 @@ def test_reno_identical(quadratic):
     assert clearsky.reno(quadratic, quadratic).all()
 
 
-@pytest.mark.skip(reason="GH #105")
+@pytest.mark.skipif(is_old_pvlib, reason="GH #105")
 @pytest.mark.filterwarnings("ignore:Support for multi-dimensional indexing")
 @pytest.mark.filterwarnings("ignore:invalid value encountered in")
 def test_reno_begining_end(quadratic):