Skip to content

Commit 25d85f8

Browse files
committed
Fix typos and pep issues
1 parent c555241 commit 25d85f8

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

windpowerlib/data.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def get_turbine_types(turbine_library="local", print_out=True, filter_=True):
5858
If the power (coefficient) curve of the desired turbine type (or the
5959
turbine type itself) is missing you can contact us via github or
6060
[email protected]. You can help us by providing data in the
61-
format as shown in
62-
`the data base <https://openenergy-platform.org/dataedit/view/supply/wind_turbine_library>`_.
61+
format as shown in `the data base
62+
<https://openenergy-platform.org/dataedit/view/supply/wind_turbine_library>`_.
6363
6464
Examples
6565
--------
@@ -265,7 +265,7 @@ def remove_tmp_file(filename, time_stamp):
265265

266266
def check_imported_data(data, filename, time_stamp):
267267
try:
268-
data = check_data_integretiy(data)
268+
data = check_data_integrity(data)
269269
except Exception as e:
270270
copyfile(
271271
filename.format("turbine_data"),
@@ -291,31 +291,32 @@ def check_imported_data(data, filename, time_stamp):
291291
return data
292292

293293

294-
def check_data_integretiy(data, min_pc_length=5):
295-
for dataset in data.iterrows():
296-
ttype = dataset[0]
297-
enercon_e126 = {"turbine_type": "{0}".format(ttype), "hub_height": 135}
294+
def check_data_integrity(data, min_pc_length=5):
295+
for data_set in data.iterrows():
296+
wt_type = data_set[0]
297+
enercon_e126 = {"turbine_type": "{0}".format(wt_type),
298+
"hub_height": 135}
298299
with warnings.catch_warnings():
299300
warnings.simplefilter("ignore")
300301
wt = WindTurbine(**enercon_e126)
301-
if wt.power_curve is None and dataset[1].has_power_curve is True:
302+
if wt.power_curve is None and data_set[1].has_power_curve is True:
302303
logging.warning(
303304
"{0}: No power curve but has_power_curve=True.".format(
304-
ttype
305+
wt_type
305306
)
306307
)
307308
if (
308309
wt.power_coefficient_curve is None
309-
and dataset[1].has_cp_curve is True
310+
and data_set[1].has_cp_curve is True
310311
):
311312
logging.warning(
312-
"{0}: No cp-curve but has_cp_curve=True.".format(ttype)
313+
"{0}: No cp-curve but has_cp_curve=True.".format(wt_type)
313314
)
314315
if wt.power_curve is not None:
315316
if len(wt.power_curve) < min_pc_length:
316317
logging.warning(
317-
"{0}: power_curve is to short ({1} values),".format(
318-
ttype, len(wt.power_curve)
318+
"{0}: power_curve is too short ({1} values),".format(
319+
wt_type, len(wt.power_curve)
319320
)
320321
)
321322
return data

0 commit comments

Comments
 (0)