Skip to content

Commit

Permalink
add test energy from power shifted data
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-springer committed Dec 18, 2024
1 parent 2fc733d commit 58eab97
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions rdtools/test/analysis_chains_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,3 +740,21 @@ def test_plot_degradation_timeseries(sensor_analysis, clearsky_analysis):
assert_isinstance(
clearsky_analysis.plot_degradation_timeseries("clearsky"), plt.Figure
)


def test_energy_from_power_hourly_data():

times = pd.date_range("2019-01-01 00:00:00", periods=3, freq="H")
pv = pd.Series([1.2, 2.8, 2.0], index=times)

energy = normalization.energy_from_power(pv)
pd.testing.assert_series_equal(energy, pv[1:], check_names=False)


def test_energy_from_power_shifted_hourly_data():

times = pd.date_range("2019-01-01 00:30:00", periods=3, freq="H")
pv = pd.Series([1.2, 2.8, 2.0], index=times)

energy = normalization.energy_from_power(pv)
pd.testing.assert_series_equal(energy, pv[1:], check_names=False)

0 comments on commit 58eab97

Please sign in to comment.