Skip to content

Commit acbb212

Browse files
committed
Move assignment of nominal power to fetch_turbine_data()
1 parent 1128ec6 commit acbb212

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

windpowerlib/wind_turbine.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ def __init__(self, turbine_name, hub_height, d_rotor, cp_values=None,
100100
self.power_output = None
101101

102102
if (self.cp_values is None and self.p_values is None):
103-
p_nom = self.fetch_turbine_data()
104-
if self.nominal_power is None:
105-
self.nominal_power = p_nom
103+
self.fetch_turbine_data()
106104

107105
def fetch_turbine_data(self):
108106
r"""
@@ -174,7 +172,9 @@ def restructure_data():
174172
else:
175173
filename = 'cp_curves.csv'
176174
self.cp_values, p_nom = restructure_data()
177-
return p_nom
175+
if self.nominal_power is None:
176+
self.nominal_power = p_nom
177+
return self
178178

179179

180180
def read_turbine_data(**kwargs):

0 commit comments

Comments
 (0)