Skip to content

Commit 607ed4e

Browse files
committed
Raise error if (p- or cp-)values for power output calculation mode are missing
1 parent 1550f87 commit 607ed4e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

windpowerlib/modelchain.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ def turbine_power_output(self, v_wind, rho_hub):
275275
276276
"""
277277
if self.power_output_model == 'cp_values':
278+
if self.wind_turbine.cp_values is None:
279+
raise TypeError("Cp values of " +
280+
self.wind_turbine.turbine_name +
281+
" are missing.")
278282
if self.density_corr is False:
279283
logging.debug('Calculating power output using cp curve.')
280284
output = power_output.cp_curve(v_wind, rho_hub,
@@ -291,6 +295,10 @@ def turbine_power_output(self, v_wind, rho_hub):
291295
self.density_corr)) + "`density_corr` must " +
292296
"be Boolean (True or False).")
293297
elif self.power_output_model == 'p_values':
298+
if self.wind_turbine.p_values is None:
299+
raise TypeError("P values of " +
300+
self.wind_turbine.turbine_name +
301+
" are missing.")
294302
if self.density_corr is False:
295303
logging.debug('Calculating power output using power curve.')
296304
output = power_output.p_curve(self.wind_turbine.p_values,

0 commit comments

Comments
 (0)