Skip to content

Commit 9be9fd4

Browse files
Merge remote-tracking branch 'origin/development' into attempt_refactor_soiling_pr
2 parents 2fa047c + 1476f02 commit 9be9fd4

File tree

16 files changed

+1088
-44
lines changed

16 files changed

+1088
-44
lines changed

.github/workflows/nbval.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
pip install --timeout=300 -r requirements.txt -r docs/notebook_requirements.txt .[test]
3030
- name: Run notebook and check output
3131
run: |
32-
# --sanitize-with: pre-process text to remove irrelevant differences (e.g. warning filepaths)
32+
# --nbval-sanitize-with: pre-process text to remove irrelevant differences (e.g. warning filepaths)
3333
pytest --nbval --nbval-sanitize-with docs/nbval_sanitization_rules.cfg docs/${{ matrix.notebook-file }}
3434
- name: Run notebooks again, save files
3535
run: |

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
# ignore byte compiled files
88
*.py[co]
99

10-
# ignore coveralls yaml, coverge dir
10+
# ignore coveralls yaml, coverage dir
1111
.coveralls.yml
1212
.coverage
13+
.coverage.*
1314
htmlcov/
1415

1516
# ignore test cache

docs/Multi-year_on_year_example.ipynb

Lines changed: 479 additions & 0 deletions
Large diffs are not rendered by default.

docs/notebook_requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ nbconvert==7.17.0
3030
nbformat==5.10.4
3131
nest-asyncio==1.6.0
3232
notebook==7.2.2
33-
numexpr==2.10.1
33+
numexpr==2.10.2
3434
pandocfilters==1.5.1
3535
parso==0.8.4
3636
pexpect==4.9.0
@@ -45,6 +45,7 @@ qtconsole==5.5.2
4545
Send2Trash==1.8.3
4646
simplegeneric==0.8.1
4747
soupsieve==2.6
48+
tabulate==0.9.0
4849
terminado==0.18.1
4950
testpath==0.6.0
5051
tinycss2==1.2.1
@@ -53,3 +54,4 @@ traitlets==5.14.3
5354
wcwidth==0.2.13
5455
webencodings==0.5.1
5556
widgetsnbextension==4.0.11
57+

docs/sphinx/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
RdTools Change Log
22
==================
33
.. include:: changelog/pending.rst
4+
.. include:: changelog/v3.2.0.rst
45
.. include:: changelog/v3.1.0.rst
56
.. include:: changelog/v3.0.1.rst
67
.. include:: changelog/v3.0.0.rst

docs/sphinx/source/changelog/v3.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
****************************
2-
v3.1.0 (February XX, 2026)
2+
v3.1.0 (March 05, 2026)
33
****************************
44

55
Enhancements
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
*************************
2+
v3.2.0 (X, X, 2026)
3+
*************************
4+
5+
Enhancements
6+
------------
7+
* :py:func:`~rdtools.degradation.degradation_year_on_year` has new parameter ``label=``
8+
to return the calc_info['YoY_values'] as either right labeled (default), left or
9+
center labeled. (:issue:`459`)
10+
* :py:func:`~rdtools.plotting.degradation_timeseries_plot` now defaults to rolling
11+
median, centered on the timestamp (pd.rolling(center=True)), and reduces
12+
``min_periods`` from ``rolling_days//2`` to ``rolling_days//4``.
13+
(:issue:`455`)
14+
* :py:func:`~rdtools.degradation.degradation_year_on_year` has new parameter ``multi_yoy``
15+
(default False) to trigger multiple YoY degradation calculations similar to Hugo Quest et
16+
al 2023. In this mode, instead of a series of 1-year duration slopes, 2-year, 3-year etc
17+
slopes are also included. calc_info['YoY_values'] returns a non-monotonic index
18+
in this mode due to multiple overlapping annual slopes. (:issue:`394`)
19+
* :py:func:`~rdtools.plotting.degradation_timeseries_plot` now supports ``multi_yoy=True``
20+
data by resampling overlapping YoY values to their mean. A warning is issued when this
21+
resampling occurs. (:issue:`394`)
22+
* :py:func:`~rdtools.plotting.degradation_summary_plots` ``detailed=True`` mode now
23+
properly handles points used odd vs even number of times (not just 0, 1, 2).
24+
(:issue:`394`)
25+
* :py:func:`~rdtools.degradation.degradation_year_on_year` now returns
26+
``calc_info['YoY_times']`` DataFrame with ``dt_right``, ``dt_center``, and ``dt_left``
27+
columns for each YoY slope. (:issue:`459`)
28+
* Added new example notebook ``docs/Multi-year_on_year_example.ipynb`` demonstrating the
29+
``label='center'`` and ``multi_yoy=True`` features of
30+
:py:func:`~rdtools.degradation.degradation_year_on_year`. (:issue:`394`)
31+
* :py:meth:`~rdtools.analysis_chains.TrendAnalysis.sensor_analysis` and
32+
:py:meth:`~rdtools.analysis_chains.TrendAnalysis.clearsky_analysis` now
33+
explicitly default ``yoy_kwargs={"label": "right"}``.
34+
35+
Bug Fixes
36+
---------
37+
* Fixed ``usage_of_points`` calculation in :py:func:`~rdtools.degradation.degradation_year_on_year`
38+
to properly handle ``multi_yoy=True`` mode with overlapping slopes. (:issue:`394`)
39+
40+
41+
Maintenance
42+
-----------
43+
* Added ``_avg_timestamp_old_Pandas`` helper function for pandas <2.0 compatibility
44+
when calculating center labels.
45+
* Fixed nbval workflow command syntax (``--sanitize-with`` to ``--nbval-sanitize-with``).
46+
* Improved pandas 3.0 compatibility with datetime resolution handling.
47+
* Updated ``docs/notebook_requirements.txt`` to require ``numexpr>=2.10.2`` and
48+
``tabulate>=0.9.0`` to satisfy pandas' optional dependency minimum versions and
49+
avoid related warnings/errors.
50+
* Removed trailing semicolons in example notebooks.
51+
* Added ``.coverage.*`` pattern to ``.gitignore``.
52+
53+
Testing
54+
-------
55+
* Added tests for error handling paths in :py:mod:`~rdtools.analysis_chains`:
56+
``filter_params`` and ``filter_params_aggregated`` setter validation,
57+
``clearsky_rescale_index_mismatch``, ``poa_filter_without_poa``,
58+
``tcell_filter_without_temperature``, ``hour_angle_filter_without_location``,
59+
``clearsky_filter_without_poa``, and ``degradation_timeseries_plot_invalid_case``.
60+
* Added tests for error handling paths in :py:mod:`~rdtools.degradation`:
61+
``classical_decomposition`` missing/irregular data, ``year_on_year`` circular block
62+
validation, no valid pairs error, and ``_mk_test`` edge cases (no trend, ties,
63+
decreasing).
64+
* Added test for ``multi_yoy=True`` parameter in ``degradation_year_on_year``.
65+
* Added tests for :py:func:`~rdtools.plotting.degradation_timeseries_plot`
66+
covering ``label='center'``, ``label='left'``, multi-YoY duplicate index
67+
handling, and ``KeyError`` path.
68+
* Set matplotlib backend to ``Agg`` in test ``conftest.py`` to avoid tkinter issues.
69+
70+
71+
Contributors
72+
------------
73+
* Chris Deline (:ghuser:`cdeline`)
74+
* Martin Springer (:ghuser:`martin-springer`)
75+

docs/sphinx/source/examples.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ This page shows example usage of the RdTools analysis functions.
2727
examples/TrendAnalysis_example
2828
examples/TrendAnalysis_example_NSRDB
2929
examples/system_availability_example
30+
examples/Multi-year_on_year_example
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../Multi-year_on_year_example.ipynb"
3+
}

rdtools/analysis_chains.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def _clearsky_preprocess(self):
10011001
)
10021002

10031003
def sensor_analysis(
1004-
self, analyses=["yoy_degradation"], yoy_kwargs={}, srr_kwargs={}
1004+
self, analyses=["yoy_degradation"], yoy_kwargs={"label": "right"}, srr_kwargs={}
10051005
):
10061006
"""
10071007
Perform entire sensor-based analysis workflow.
@@ -1014,6 +1014,7 @@ def sensor_analysis(
10141014
and 'srr_soiling'
10151015
yoy_kwargs : dict
10161016
kwargs to pass to :py:func:`rdtools.degradation.degradation_year_on_year`
1017+
default is {"label": "right"}, which will right-label the YoY slope values.
10171018
srr_kwargs : dict
10181019
kwargs to pass to :py:func:`rdtools.soiling.soiling_srr`
10191020
@@ -1041,7 +1042,7 @@ def sensor_analysis(
10411042
self.results["sensor"] = sensor_results
10421043

10431044
def clearsky_analysis(
1044-
self, analyses=["yoy_degradation"], yoy_kwargs={}, srr_kwargs={}
1045+
self, analyses=["yoy_degradation"], yoy_kwargs={"label": "right"}, srr_kwargs={}
10451046
):
10461047
"""
10471048
Perform entire clear-sky-based analysis workflow. Results are stored
@@ -1053,7 +1054,8 @@ def clearsky_analysis(
10531054
Analyses to perform as a list of strings. Valid entries are 'yoy_degradation'
10541055
and 'srr_soiling'
10551056
yoy_kwargs : dict
1056-
kwargs to pass to :py:func:`rdtools.degradation.degradation_year_on_year`
1057+
kwargs to pass to :py:func:`rdtools.degradation.degradation_year_on_year`.
1058+
default is {"label": "right"}, which will right-label the YoY slope values.
10571059
srr_kwargs : dict
10581060
kwargs to pass to :py:func:`rdtools.soiling.soiling_srr`
10591061

0 commit comments

Comments
 (0)