Skip to content

Commit 556853b

Browse files
Birgit SchachlerBirgit Schachler
authored andcommitted
Dont calculate density in ModelChain.run_model if not needed
1 parent 93ce1d3 commit 556853b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

windpowerlib/modelchain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ def run_model(self, weather, data_height):
345345
346346
"""
347347
v_wind = self.v_wind_hub(weather, data_height)
348-
rho_hub = self.rho_hub(weather, data_height)
348+
rho_hub = None if (self.power_output_model=='p_values' and
349+
self.density_corr==False) \
350+
else self.rho_hub(weather, data_height)
349351
self.power_output = self.turbine_power_output(v_wind, rho_hub)
350352
return self

0 commit comments

Comments
 (0)