Skip to content

Commit 5d33233

Browse files
committed
Revert "Fixing style errors."
This reverts commit 92f589a.
1 parent 9563bd8 commit 5d33233

File tree

2 files changed

+15
-35
lines changed

2 files changed

+15
-35
lines changed

windpowerlib/power_output.py

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -237,37 +237,18 @@ def power_curve_density_correction(
237237
238238
"""
239239
if density is None:
240-
raise TypeError(
241-
"`density` is None. For the calculation with a "
242-
+ "density corrected power curve density at hub "
243-
+ "height is needed."
244-
)
245-
power_output = [
246-
(
247-
np.interp(
248-
wind_speed[i],
249-
power_curve_wind_speeds
250-
* (1.225 / density[i])
251-
** (
252-
np.interp(
253-
power_curve_wind_speeds, [7.5, 12.5], [1 / 3, 2 / 3]
254-
)
255-
),
256-
power_curve_values,
257-
left=0,
258-
right=0,
259-
)
260-
)
261-
for i in range(len(wind_speed))
262-
]
240+
raise TypeError("`density` is None. For the calculation with a " +
241+
"density corrected power curve density at hub " +
242+
"height is needed.")
243+
power_output=[(np.interp(
244+
wind_speed[i], power_curve_wind_speeds * (1.225 / density[i]) ** (
245+
np.interp(power_curve_wind_speeds, [7.5, 12.5], [1/3, 2/3])),
246+
power_curve_values, left=0, right=0)) for i in range(len(wind_speed))]
263247

264248
# Power_output as pd.Series if wind_speed is pd.Series (else: np.array)
265249
if isinstance(wind_speed, pd.Series):
266-
power_output = pd.Series(
267-
data=power_output,
268-
index=wind_speed.index,
269-
name="feedin_power_plant",
270-
)
250+
power_output=pd.Series(data=power_output, index=wind_speed.index,
251+
name='feedin_power_plant')
271252
else:
272-
power_output = np.array(power_output)
253+
power_output=np.array(power_output)
273254
return power_output

windpowerlib/wind_speed.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,10 @@ def hellman(
171171
if hellman_exponent is None:
172172
if roughness_length is not None:
173173
# Return np.array if wind_speed is np.array
174-
if isinstance(wind_speed, np.ndarray) and isinstance(
175-
roughness_length, pd.Series
176-
):
177-
roughness_length = np.array(roughness_length)
178-
hellman_exponent = 1 / np.log(hub_height / roughness_length)
174+
if (isinstance(wind_speed, np.ndarray) and
175+
isinstance(roughness_length, pd.Series)):
176+
roughness_length=np.array(roughness_length)
177+
hellman_exponent=1 / np.log(hub_height / roughness_length)
179178
else:
180-
hellman_exponent = 1 / 7
179+
hellman_exponent=1/7
181180
return wind_speed * (hub_height / wind_speed_height) ** hellman_exponent

0 commit comments

Comments
 (0)