Skip to content

Commit

Permalink
Use csi clearsky filter in a number of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeceglie committed Apr 18, 2024
1 parent 236014f commit d5c8cf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rdtools/test/analysis_chains_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def test_filter_ad_hoc_warnings(workflow, sensor_parameters):
rd_analysis.sensor_analysis(analyses=['yoy_degradation'])
components = rd_analysis.sensor_filter_components
else:
rd_analysis.filter_params['clearsky_filter'] = {'model':'csi'}
rd_analysis.clearsky_analysis(analyses=['yoy_degradation'])
components = rd_analysis.clearsky_filter_components

Expand Down Expand Up @@ -345,6 +346,7 @@ def clearsky_parameters(basic_parameters, sensor_parameters,
# functions to generate the data.
rd_analysis = TrendAnalysis(**sensor_parameters)
rd_analysis.set_clearsky(**cs_input)
rd_analysis.filter_params['clearsky_filter'] = {'model':'csi'}
rd_analysis._clearsky_preprocess()
poa = rd_analysis.poa_global_clearsky
clearsky_parameters = basic_parameters
Expand All @@ -357,6 +359,7 @@ def clearsky_parameters(basic_parameters, sensor_parameters,
def clearsky_analysis(cs_input, clearsky_parameters):
rd_analysis = TrendAnalysis(**clearsky_parameters)
rd_analysis.set_clearsky(**cs_input)
rd_analysis.filter_params['clearsky_filter'] = {'model':'csi'}
rd_analysis.clearsky_analysis(analyses=['yoy_degradation'])
return rd_analysis

Expand Down Expand Up @@ -404,6 +407,7 @@ def clearsky_analysis_exp_power(clearsky_parameters, clearsky_optional):
clearsky_parameters['power_expected'] = power_expected
rd_analysis = TrendAnalysis(**clearsky_parameters)
rd_analysis.set_clearsky(**clearsky_optional)
rd_analysis.filter_params['clearsky_filter'] = {'model':'csi'}
rd_analysis.clearsky_analysis(analyses=['yoy_degradation'])
return rd_analysis

Expand Down Expand Up @@ -483,6 +487,7 @@ def soiling_analysis_clearsky(soiling_parameters, cs_input):
soiling_analysis = TrendAnalysis(**soiling_parameters)
soiling_analysis.set_clearsky(**cs_input)
np.random.seed(1977)
soiling_analysis.filter_params['clearsky_filter'] = {'model':'csi'}
with pytest.warns(UserWarning, match='20% or more of the daily data'):
soiling_analysis.clearsky_analysis(analyses=['srr_soiling'],
srr_kwargs={'reps': 10})
Expand Down Expand Up @@ -548,13 +553,10 @@ def test_errors(sensor_parameters, clearsky_analysis):
rdtemp._sensor_preprocess()

# clearsky analysis with no tilt/azm
clearsky_analysis.pv_tilt = None
clearsky_analysis.poa_global_clearsky = None
with pytest.raises(ValueError, match='pv_tilt and pv_azimuth must be provided'):
clearsky_analysis._clearsky_preprocess()

# clearsky analysis with no pvlib.loc
clearsky_analysis.pvlib_location = None
with pytest.raises(ValueError, match='pvlib location must be provided'):
clearsky_analysis._clearsky_preprocess()

Expand Down

0 comments on commit d5c8cf5

Please sign in to comment.