Skip to content

Commit 4454e82

Browse files
committed
Merge branch 'features/use-WindTurbineGroup-in-cluster' of github.com:wind-python/windpowerlib into features/allow-turbines-and-groups-in-WindTurbineCluster
2 parents 3ef8b2b + 0965bd8 commit 4454e82

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

windpowerlib/wind_turbine.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,7 @@ def to_group(self, number_turbines=None, total_capacity=None):
317317
# This is working for Python >= 3.5.
318318
# There a cleaner solutions for Python >= 3.6, once the support of 3.5 is
319319
# dropped: https://stackoverflow.com/a/50038614
320-
class WindTurbineGroup(
321-
NamedTuple(
322-
"WindTurbineGroup",
323-
[("wind_turbine", WindTurbine), ("number_of_turbines", float)],
324-
)
325-
):
320+
class WindTurbineGroup:
326321
"""
327322
A simple data container to define more than one turbine of the same type.
328323
Use the :func:`~windpowerlib.wind_turbine.WindTurbine.to_group` method to
@@ -337,15 +332,22 @@ class WindTurbineGroup(
337332
The number of turbines. The number is not restricted to integer values.
338333
"""
339334

340-
__slots__ = ()
335+
# __slots__ = ()
336+
337+
def __init__(self, wind_turbine, number_of_turbines):
338+
self.wind_turbine = wind_turbine
339+
self.number_of_turbines = number_of_turbines
340+
self.hub_height = self.wind_turbine.hub_height
341+
self.nominal_power = (self.wind_turbine.nominal_power *
342+
self.number_of_turbines)
341343

342344

343-
WindTurbineGroup.wind_turbine.__doc__ = (
344-
"A :class:`~windpowerlib.wind_farm.WindTurbine` object."
345-
)
346-
WindTurbineGroup.number_of_turbines.__doc__ = (
347-
"Number of turbines of type WindTurbine"
348-
)
345+
# WindTurbineGroup.wind_turbine.__doc__ = (
346+
# "A :class:`~windpowerlib.wind_farm.WindTurbine` object."
347+
# )
348+
# WindTurbineGroup.number_of_turbines.__doc__ = (
349+
# "Number of turbines of type WindTurbine"
350+
# )
349351

350352

351353
def get_turbine_data_from_file(turbine_type, path):

0 commit comments

Comments
 (0)