diff --git a/pvanalytics/__init__.py b/pvanalytics/__init__.py
index e69de29..432885d 100644
--- a/pvanalytics/__init__.py
+++ b/pvanalytics/__init__.py
@@ -0,0 +1,6 @@
+from pvanalytics import features   # noqa: F401
+from pvanalytics import filtering  # noqa: F401
+from pvanalytics import fitting    # noqa: F401
+from pvanalytics import metrics    # noqa: F401
+from pvanalytics import quality    # noqa: F401
+from pvanalytics import system     # noqa: F401
diff --git a/pvanalytics/features/__init__.py b/pvanalytics/features/__init__.py
index e69de29..dfb7a12 100644
--- a/pvanalytics/features/__init__.py
+++ b/pvanalytics/features/__init__.py
@@ -0,0 +1,2 @@
+from pvanalytics.features import clearsky  # noqa: F401
+from pvanalytics.features import clipping  # noqa: F401
diff --git a/pvanalytics/fitting/__init__.py b/pvanalytics/fitting/__init__.py
index e69de29..6ec9e6b 100644
--- a/pvanalytics/fitting/__init__.py
+++ b/pvanalytics/fitting/__init__.py
@@ -0,0 +1,1 @@
+from pvanalytics.fitting import temperature  # noqa: F401
diff --git a/pvanalytics/quality/__init__.py b/pvanalytics/quality/__init__.py
index e69de29..7a4c60f 100644
--- a/pvanalytics/quality/__init__.py
+++ b/pvanalytics/quality/__init__.py
@@ -0,0 +1,6 @@
+from pvanalytics.quality import gaps        # noqa: F401
+from pvanalytics.quality import util        # noqa: F401
+from pvanalytics.quality import irradiance  # noqa: F401
+from pvanalytics.quality import weather     # noqa: F401
+from pvanalytics.quality import outliers    # noqa: F401
+from pvanalytics.quality import time        # noqa: F401
diff --git a/pvanalytics/quality/gaps.py b/pvanalytics/quality/gaps.py
index 61d78e9..ff872da 100644
--- a/pvanalytics/quality/gaps.py
+++ b/pvanalytics/quality/gaps.py
@@ -15,9 +15,12 @@ def _all_close_to_first(x, rtol=1e-5, atol=1e-8):
     ----------
     x : array
     rtol : float, default 1e-5
-        Relative tolerance for detecting a change in data values.
+        Tolerance for detecting a change relative to x[0].
     atol : float, default 1e-8
-        Absolute tolerance for detecting a change in data values.
+        Absolute tolerance for detecting a change from x[0].
+
+    Parameters rtol and atol have the same meaning as in
+    numpy.allclose.
 
     Returns
     -------
@@ -48,7 +51,7 @@ def _backfill_window(endpoints, window):
     return flags
 
 
-def stale_values_diff(x, window=3, rtol=1e-5, atol=1e-8, label_all=False):
+def stale_values_diff(x, window=6, rtol=1e-5, atol=1e-8, label_all=False):
     """Identify stale values in the data.
 
     For a window of length N, the last value (index N-1) is considered
@@ -62,7 +65,7 @@ def stale_values_diff(x, window=3, rtol=1e-5, atol=1e-8, label_all=False):
     ----------
     x : Series
         data to be processed
-    window : int, default 3
+    window : int, default 6
         number of consecutive values which, if unchanged, indicates
         stale data
     rtol : float, default 1e-5
@@ -105,7 +108,7 @@ def stale_values_diff(x, window=3, rtol=1e-5, atol=1e-8, label_all=False):
     return flags
 
 
-def interpolation_diff(x, window=3, rtol=1e-5, atol=1e-8, label_all=False):
+def interpolation_diff(x, window=6, rtol=1e-5, atol=1e-8, label_all=False):
     """Identify sequences which appear to be linear.
 
     Sequences are linear if the first difference appears to be
@@ -119,7 +122,7 @@ def interpolation_diff(x, window=3, rtol=1e-5, atol=1e-8, label_all=False):
     ----------
     x : Series
         data to be processed
-    window : int, default 3
+    window : int, default 6
         number of sequential values that, if the first difference is
         constant, are classified as a linear sequence
     rtol : float, default 1e-5

Increase default window in stale_values_diff and interpolation_diff
Consider setting `window=6` as default. See [discussion](https://github.com/SolarArbiter/solarforecastarbiter-core/issues/124#issuecomment-631754114)

diff --git a/pvanalytics/tests/quality/test_gaps.py b/pvanalytics/tests/quality/test_gaps.py
index 036225c..6c27558 100644
--- a/pvanalytics/tests/quality/test_gaps.py
+++ b/pvanalytics/tests/quality/test_gaps.py
@@ -52,13 +52,16 @@ def test_stale_values_diff(stale_data):
     for more information.
 
     """
-    res1 = gaps.stale_values_diff(stale_data)
+    res0 = gaps.stale_values_diff(stale_data)
+    res1 = gaps.stale_values_diff(stale_data, window=3)
     res2 = gaps.stale_values_diff(stale_data, rtol=1e-8, window=2)
     res3 = gaps.stale_values_diff(stale_data, window=7)
     res4 = gaps.stale_values_diff(stale_data, window=8)
     res5 = gaps.stale_values_diff(stale_data, rtol=1e-8, window=4)
-    res6 = gaps.stale_values_diff(stale_data[1:])
-    res7 = gaps.stale_values_diff(stale_data[1:8])
+    res6 = gaps.stale_values_diff(stale_data[1:], window=3)
+    res7 = gaps.stale_values_diff(stale_data[1:8], window=3)
+    assert_series_equal(res0, pd.Series([False, False, False, False, False,
+                                         False, True, True, False, False]))
     assert_series_equal(res1, pd.Series([False, False, False, True, True, True,
                                          True, True, False, False]))
     assert_series_equal(res2, pd.Series([False, False, True, True, True, False,
@@ -88,16 +91,16 @@ def test_stale_values_diff_handles_negatives(data_with_negatives):
     for more information.
 
     """
-    res = gaps.stale_values_diff(data_with_negatives)
+    res = gaps.stale_values_diff(data_with_negatives, window=3)
     assert_series_equal(res, pd.Series([False, False, True, True, False, False,
                                         False]))
-    res = gaps.stale_values_diff(data_with_negatives, atol=1e-3)
+    res = gaps.stale_values_diff(data_with_negatives, window=3, atol=1e-3)
     assert_series_equal(res, pd.Series([False, False, True, True, True, True,
                                         True]))
-    res = gaps.stale_values_diff(data_with_negatives, atol=1e-5)
+    res = gaps.stale_values_diff(data_with_negatives, window=3, atol=1e-5)
     assert_series_equal(res, pd.Series([False, False, True, True, True, False,
                                         False]))
-    res = gaps.stale_values_diff(data_with_negatives, atol=2e-5)
+    res = gaps.stale_values_diff(data_with_negatives, window=3, atol=2e-5)
     assert_series_equal(res, pd.Series([False, False, True, True, True, True,
                                         True]))
 
@@ -170,12 +173,17 @@ def test_interpolation_diff(interpolated_data):
     for more information.
 
     """
-    res1 = gaps.interpolation_diff(interpolated_data)
+    res0 = gaps.interpolation_diff(interpolated_data)
+    assert_series_equal(res0, pd.Series([False, False, False, False, False,
+                                         False, False, False, False, False,
+                                         False, False, False, False, False,
+                                         False, False]))
+    res1 = gaps.interpolation_diff(interpolated_data, window=3)
     assert_series_equal(res1, pd.Series([False, False, False, False, False,
                                          False, False, True, False, False,
                                          False, False, False, True, True, True,
                                          False]))
-    res2 = gaps.interpolation_diff(interpolated_data, rtol=1e-2)
+    res2 = gaps.interpolation_diff(interpolated_data, window=3, rtol=1e-2)
     assert_series_equal(res2, pd.Series([False, False, True, True, True,
                                          False, False, True, False, False,
                                          False, False, False, True, True, True,
@@ -185,7 +193,7 @@ def test_interpolation_diff(interpolated_data):
                                          False, False, False, False, False,
                                          False, False, False, False, False,
                                          True, False]))
-    res4 = gaps.interpolation_diff(interpolated_data, atol=1e-2)
+    res4 = gaps.interpolation_diff(interpolated_data, window=3, atol=1e-2)
     assert_series_equal(res4, pd.Series([False, False, True, True, True,
                                          True, True, True, False, False,
                                          False, False, False, True, True, True,
@@ -204,10 +212,10 @@ def test_interpolation_diff_handles_negatives(data_with_negatives):
     for more information.
 
     """
-    res = gaps.interpolation_diff(data_with_negatives, atol=1e-5)
+    res = gaps.interpolation_diff(data_with_negatives, window=3, atol=1e-5)
     assert_series_equal(res, pd.Series([False, False, True, True, True, True,
                                         False]))
-    res = gaps.stale_values_diff(data_with_negatives, atol=1e-4)
+    res = gaps.stale_values_diff(data_with_negatives, window=3, atol=1e-4)
     assert_series_equal(res, pd.Series([False, False, True, True, True, True,
                                         True]))
 

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
docutils==0.20.1
exceptiongroup==1.2.2
h5py==3.8.0
idna==3.10
imagesize==1.4.1
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
MarkupSafe==2.1.5
numpy==1.21.6
packaging==24.0
pandas==1.3.5
pluggy==1.2.0
-e git+https://github.com/pvlib/pvanalytics.git@b37dcf837b891997fd00be8e5a2aedf1853a4717#egg=pvanalytics
pvlib==0.10.4
Pygments==2.17.2
pytest==7.4.4
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.31.0
scipy==1.7.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==2.2.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
zipp==3.15.0

name: pvanalytics
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - babel==2.14.0
      - charset-normalizer==3.4.1
      - docutils==0.20.1
      - exceptiongroup==1.2.2
      - h5py==3.8.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - markupsafe==2.1.5
      - numpy==1.21.6
      - packaging==24.0
      - pandas==1.3.5
      - pluggy==1.2.0
      - pvlib==0.10.4
      - pygments==2.17.2
      - pytest==7.4.4
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.31.0
      - scipy==1.7.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==2.2.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - zipp==3.15.0
prefix: /opt/conda/envs/pvanalytics

pvanalytics/tests/quality/test_gaps.py::test_stale_values_diff pvanalytics/tests/quality/test_gaps.py::test_interpolation_diff
pvanalytics/tests/quality/test_gaps.py::test_stale_values_diff_handles_negatives pvanalytics/tests/quality/test_gaps.py::test_stale_values_diff_raises_error pvanalytics/tests/quality/test_gaps.py::test_stale_values_diff_label_all pvanalytics/tests/quality/test_gaps.py::test_interpolation_diff_label_all pvanalytics/tests/quality/test_gaps.py::test_interpolation_diff_handles_negatives pvanalytics/tests/quality/test_gaps.py::test_interpolation_diff_raises_error pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_all_true pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_first_day_false pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_first_and_fifth_days_missing pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_last_two_days_missing pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_all_false pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_not_enough_days pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_one_day pvanalytics/tests/quality/test_gaps.py::test_start_stop_dates_with_gaps_in_middle pvanalytics/tests/quality/test_gaps.py::test_trim_incomplete pvanalytics/tests/quality/test_gaps.py::test_trim_incomplete_empty pvanalytics/tests/quality/test_gaps.py::test_trim_daily_index pvanalytics/tests/quality/test_gaps.py::test_completeness_score_all_nans pvanalytics/tests/quality/test_gaps.py::test_completeness_score_no_data pvanalytics/tests/quality/test_gaps.py::test_completeness_score_incomplete_index pvanalytics/tests/quality/test_gaps.py::test_completeness_score_complete pvanalytics/tests/quality/test_gaps.py::test_completeness_score_freq_too_high pvanalytics/tests/quality/test_gaps.py::test_completeness_score_reindex pvanalytics/tests/quality/test_gaps.py::test_complete_threshold_zero pvanalytics/tests/quality/test_gaps.py::test_complete_threshold_one pvanalytics/tests/quality/test_gaps.py::test_complete
pvanalytics/__init__.py pvanalytics/quality/gaps.py pvanalytics/fitting/__init__.py pvanalytics/features/__init__.py pvanalytics/quality/__init__.py
pvanalytics/__init__.py pvanalytics/quality/gaps.py pvanalytics/fitting/__init__.py pvanalytics/features/__init__.py pvanalytics/quality/__init__.py