Skip to content

Commit

Permalink
added more coverage test and README script for example
Browse files Browse the repository at this point in the history
  • Loading branch information
qnguyen345 committed Aug 19, 2024
1 parent 0a32751 commit 9ecd103
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/examples/energy/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Energy
----------------

This includes examples for identifying and correcting cumulative energy time series.
10 changes: 10 additions & 0 deletions pvanalytics/tests/quality/test_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ def test_convert_cumulative_with_simple_diff(cumulative_series,
assert_series_equal(simple_diff_result, simple_diff_energy_series)


def test_convert_cumulative_with_avg_diff(avg_diff_energy_series):
"""
Tests convert_cumulative_energy for cumulative series.
Test returns the corrected differenced series via avgerage differencing.
"""
simple_diff_result = energy.convert_cumulative_energy(
energy_series=avg_diff_energy_series, system_self_consumption=0.0)
assert_series_equal(simple_diff_result, avg_diff_energy_series)


def test_convert_noncumulative(noncumulative_series):
"""
Tests convert_cumulative_energy for non-cumulative series.
Expand Down

0 comments on commit 9ecd103

Please sign in to comment.