Skip to content

Commit ba03c61

Browse files
committed
Use difference of values for capacity check
1 parent 4fa88a6 commit ba03c61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

windpowerlib/wind_farm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def check_and_complete_wind_turbine_fleet(self):
177177
'wind turbine is set.'.format(
178178
turbine=row['wind_turbine']))
179179
else:
180-
if not round(row['total_capacity'], 3) == round(
180+
if not abs(row['total_capacity'] - (
181181
row['number_of_turbines'] *
182-
row['wind_turbine'].nominal_power, 3):
182+
row['wind_turbine'].nominal_power)) < 1:
183183
self.wind_turbine_fleet.loc[ix, 'total_capacity'] = \
184184
row['number_of_turbines'] * \
185185
row['wind_turbine'].nominal_power

0 commit comments

Comments
 (0)