Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow turbines and groups in wind turbine cluster #102

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 16 additions & 13 deletions windpowerlib/wind_turbine.py
Expand Up @@ -317,12 +317,7 @@ def to_group(self, number_turbines=None, total_capacity=None):
# This is working for Python >= 3.5.
# There a cleaner solutions for Python >= 3.6, once the support of 3.5 is
# dropped: https://stackoverflow.com/a/50038614
class WindTurbineGroup(
NamedTuple(
"WindTurbineGroup",
[("wind_turbine", WindTurbine), ("number_of_turbines", float)],
)
):
class WindTurbineGroup:
"""
A simple data container to define more than one turbine of the same type.
Use the :func:`~windpowerlib.wind_turbine.WindTurbine.to_group` method to
Expand All @@ -337,15 +332,23 @@ class WindTurbineGroup(
The number of turbines. The number is not restricted to integer values.
"""

__slots__ = ()
# __slots__ = ()

def __init__(self, wind_turbine, number_of_turbines):
self.wind_turbine = wind_turbine
self.number_of_turbines = number_of_turbines
self.hub_height = self.wind_turbine.hub_height
self.nominal_power = (
self.wind_turbine.nominal_power * self.number_of_turbines
)


WindTurbineGroup.wind_turbine.__doc__ = (
"A :class:`~windpowerlib.wind_farm.WindTurbine` object."
)
WindTurbineGroup.number_of_turbines.__doc__ = (
"Number of turbines of type WindTurbine"
)
# WindTurbineGroup.wind_turbine.__doc__ = (
# "A :class:`~windpowerlib.wind_farm.WindTurbine` object."
# )
# WindTurbineGroup.number_of_turbines.__doc__ = (
# "Number of turbines of type WindTurbine"
# )


def get_turbine_data_from_file(turbine_type, path):
Expand Down