Skip to content

Commit 415a781

Browse files
committed
Bring the example in line with the same parameters for all variants
1 parent 9b80875 commit 415a781

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

windpowerlib/wind_farm.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,32 +82,31 @@ class WindFarm(object):
8282
... 'turbine_type': 'V90/2000',
8383
... 'nominal_power': 2e6}
8484
>>> v90 = WindTurbine(**vestasV90)
85-
>>> # turbine fleet as DataFrame with number of turbines provided
85+
>>> # turbine fleet as DataFrame with number of turbines provided (1)
8686
>>> wind_turbine_fleet = pd.DataFrame(
8787
... {'wind_turbine': [e126, v90],
88-
... 'number_of_turbines': [6, 3]})
89-
>>> example_farm = wind_farm.WindFarm(wind_turbine_fleet)
88+
... 'number_of_turbines': [6, None],
89+
... 'total_capacity': [None, 3 * 2e6]})
90+
>>> example_farm = wind_farm.WindFarm(wind_turbine_fleet, name='my_farm')
9091
>>> print(example_farm.nominal_power)
9192
31200000.0
92-
>>> # turbine fleet as list with total capacity of each turbine type
93-
>>> # provided
93+
>>> # turbine fleet as a list of WindTurbineGroup objects using the
94+
>>> # 'to_group' method (2).
95+
>>> wind_turbine_fleet = [e126.to_group(6),
96+
... v90.to_group(total_capacity=3 * 2e6)]
97+
>>> example_farm = wind_farm.WindFarm(wind_turbine_fleet, name='my_farm')
98+
>>> print(example_farm.nominal_power)
99+
31200000.0
100+
>>> # turbine fleet as list of dictionaries (not recommended)
94101
>>> example_farm_data = {
95-
... 'name': 'example_farm',
102+
... 'name': 'my_farm',
96103
... 'wind_turbine_fleet': [{'wind_turbine': e126,
97-
... 'total_capacity': 6 * 4.2e6},
104+
... 'number_of_turbines': 6},
98105
... {'wind_turbine': v90,
99106
... 'total_capacity': 3 * 2e6}]}
100107
>>> example_farm = wind_farm.WindFarm(**example_farm_data)
101108
>>> print(example_farm.nominal_power)
102109
31200000.0
103-
>>> # turbine fleet as a list of WindTurbineGroup namedtuples using the
104-
>>> # 'to_group' method.
105-
>>> wind_turbine_fleet = [e126.to_group(number_turbines=5),
106-
... e126.to_group(),
107-
... v90.to_group(total_capacity=3 * 2e6)]
108-
>>> example_farm = wind_farm.WindFarm(wind_turbine_fleet)
109-
>>> print(example_farm.nominal_power)
110-
31200000.0
111110
"""
112111

113112
def __init__(self, wind_turbine_fleet, efficiency=None, name='', **kwargs):

0 commit comments

Comments
 (0)