Skip to content

Commit

Permalink
update clearsky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-springer committed Apr 17, 2024
1 parent 5aedbe5 commit 05e5b83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rdtools/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def clearsky_filter(poa_global_measured, poa_global_clearsky, model='pvlib', **k
pvlib_clearsky_filter : Filtering based on pvlib's clearsky model.
"""

if model == "pvlib":
if model == "csi":
clearsky_mask = csi_filter(poa_global_measured, poa_global_clearsky, **kwargs)
elif model == "csi":
elif model == "pvlib":
clearsky_mask = pvlib_clearsky_filter(poa_global_measured, poa_global_clearsky, **kwargs)
else:
raise ValueError("Clearsky filter must be 'pvlib' or 'csi'.")
Expand Down
4 changes: 2 additions & 2 deletions rdtools/test/analysis_chains_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def test_aggregated_filter_ad_hoc_warnings(workflow, sensor_parameters):
rd_analysis.set_clearsky(pvlib_location=pvlib.location.Location(40, -80),
poa_global_clearsky=rd_analysis.poa_global)
# disable all filters outside of CSI
rd_analysis.filter_params = {'csi_filter': {}}
rd_analysis.filter_params = {"clearsky_filter": {'model': 'csi'}}
# warning for incomplete index
daily_ad_hoc_filter = pd.Series(True,
index=sensor_parameters['pv'].index[:-5])
Expand All @@ -300,7 +300,7 @@ def test_aggregated_filter_ad_hoc_warnings(workflow, sensor_parameters):
rd_analysis_2.set_clearsky(pvlib_location=pvlib.location.Location(40, -80),
poa_global_clearsky=rd_analysis_2.poa_global)
# disable all filters outside of CSI
rd_analysis_2.filter_params = {'csi_filter': {}}
rd_analysis_2.filter_params = {"clearsky_filter": {'model': 'csi'}}
daily_ad_hoc_filter = pd.Series(True, index=sensor_parameters['pv'].index)
daily_ad_hoc_filter = daily_ad_hoc_filter.resample(
'1D').first().dropna(how='all')
Expand Down

0 comments on commit 05e5b83

Please sign in to comment.