Skip to content

Commit 1f53eca

Browse files
committed
Remove parameter temperature_model from tests
1 parent 09a5c72 commit 1f53eca

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

tests/test_modelchain.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ def setup_class(self):
1616
'turbine_name': 'ENERCON E 126 7500'}
1717

1818
def test_rho_hub(self):
19-
# Test modelchain with rho_model='barometric' and
20-
# temperature_model='gradient'
19+
# Test modelchain with rho_model='barometric'
2120
test_mc = mc.ModelChain(wt.WindTurbine(**self.test_turbine),
22-
rho_model='barometric',
23-
temperature_model='gradient')
24-
# Test modelchain with rho_model='ideal_gas' and
25-
# temperature_model='interpolation'
21+
rho_model='barometric')
22+
# Test modelchain with rho_model='ideal_gas'
2623
test_mc_2 = mc.ModelChain(wt.WindTurbine(**self.test_turbine),
27-
rho_model='ideal_gas',
28-
temperature_model='interpolation')
24+
rho_model='ideal_gas')
2925
# Parameters for tests
3026
weather = {'temp_air': pd.Series(data=[267, 268]),
3127
'temp_air_2': pd.Series(data=[267, 266]),
@@ -110,19 +106,6 @@ def test_rho_hub(self):
110106
assert_series_equal(test_mc.rho_hub(no_temp_air_2_df, data_height),
111107
rho_exp)
112108

113-
# Raise KeyError due to missing temp_air_2 while temperature_model =
114-
# 'interpolation'
115-
with pytest.raises(KeyError):
116-
data_height['temp_air_2'] = 100
117-
no_temp_air_2_dict = dict(weather)
118-
del no_temp_air_2_dict['temp_air_2']
119-
test_mc_2.rho_hub(no_temp_air_2_dict, data_height)
120-
with pytest.raises(KeyError):
121-
data_height['temp_air_2'] = 100
122-
no_temp_air_2_df = dict(weather)
123-
del no_temp_air_2_df['temp_air_2']
124-
test_mc_2.rho_hub(no_temp_air_2_df, data_height)
125-
126109
def test_v_wind_hub(self):
127110
# Test modelchain with wind_model='logarithmic'
128111
test_mc = mc.ModelChain(wt.WindTurbine(**self.test_turbine),
@@ -258,7 +241,6 @@ def test_run_model(self):
258241
'fetch_curve': 'p'}
259242
test_modelchain = {'wind_model': 'hellman',
260243
'rho_model': 'barometric',
261-
'temperature_model': 'interpolation',
262244
'power_output_model': 'p_values',
263245
'density_corr': True}
264246

@@ -326,16 +308,9 @@ def test_run_model(self):
326308
test_mc = mc.ModelChain(wt.WindTurbine(**test_turbine),
327309
**test_modelchain)
328310
test_mc.run_model(weather, data_height)
329-
with pytest.raises(ValueError):
330-
test_modelchain['rho_model'] = 'barometric'
331-
test_modelchain['temperature_model'] = 'wrong_spelling'
332-
test_mc = mc.ModelChain(wt.WindTurbine(**test_turbine),
333-
**test_modelchain)
334-
test_mc.run_model(weather, data_height)
335311

336312
# Raise TypeErrors due to wrong type of `density_corr`
337313
with pytest.raises(TypeError):
338-
test_modelchain['temperature_model'] = 'gradient'
339314
test_modelchain['density_corr'] = 'wrong_type'
340315
test_mc = mc.ModelChain(wt.WindTurbine(**test_turbine),
341316
**test_modelchain)
@@ -355,7 +330,6 @@ def test_run_model(self):
355330
'fetch_curve': 'p'}
356331
modelchain1 = {'wind_model': 'hellman',
357332
'rho_model': 'barometric',
358-
'temperature_model': 'interpolation',
359333
'power_output_model': 'cp_values',
360334
'density_corr': True}
361335
test_mc = mc.ModelChain(wt.WindTurbine(**turbine1),
@@ -368,7 +342,6 @@ def test_run_model(self):
368342
'fetch_curve': 'cp'}
369343
modelchain2 = {'wind_model': 'hellman',
370344
'rho_model': 'barometric',
371-
'temperature_model': 'interpolation',
372345
'power_output_model': 'p_values',
373346
'density_corr': True}
374347
test_mc = mc.ModelChain(wt.WindTurbine(**turbine2),

0 commit comments

Comments
 (0)