Skip to content

Commit a6a692b

Browse files
committed
Add method to deduce the nominal value from the power curve
1 parent 160ee20 commit a6a692b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

windpowerlib/wind_turbine.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ def __repr__(self):
184184

185185
return turbine_repr
186186

187+
def deduce_nominal_power_from_power_curve(self):
188+
"""Try to deduce nominal power from power curve"""
189+
if self.power_curve is not None:
190+
self.nominal_power = max(self.power_curve['value'])
191+
else:
192+
raise ValueError("You can not deduce the nominal value from the"
193+
"power curve if the power curve is None")
194+
187195

188196
def get_turbine_data_from_file(turbine_type, path):
189197
r"""

0 commit comments

Comments
 (0)