Skip to content

Commit e28a53d

Browse files
committed
Change to US-English (initialise --> initialize)
This is to standardize the language in the windpowerlib. US-English is chosen as python libs are using it for example pandas: tz_localize()
1 parent 594f58d commit e28a53d

File tree

5 files changed

+191
-77
lines changed

5 files changed

+191
-77
lines changed

example/basic_example.ipynb

Lines changed: 163 additions & 49 deletions
Large diffs are not rendered by default.

example/basic_example.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ def get_weather_data(filename='weather.csv', **kwargs):
7474
return weather_df
7575

7676

77-
def initialise_wind_turbines():
77+
def initialize_wind_turbines():
7878
r"""
79-
Initialises two :class:`~.wind_turbine.WindTurbine` objects.
79+
Initializes two :class:`~.wind_turbine.WindTurbine` objects.
8080
81-
Function shows two ways to initialise a WindTurbine object. You can either
81+
Function shows two ways to initialize a WindTurbine object. You can either
8282
specify your own turbine, as done below for 'myTurbine', or fetch power
8383
and/or power coefficient curve data from data files provided by the
8484
windpowerlib, as done for the 'enerconE126'.
@@ -106,7 +106,7 @@ def initialise_wind_turbines():
106106
0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W
107107
'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s
108108
}
109-
# initialise WindTurbine object
109+
# initialize WindTurbine object
110110
my_turbine = WindTurbine(**myTurbine)
111111

112112
# specification of wind turbine where power curve is provided
@@ -118,7 +118,7 @@ def initialise_wind_turbines():
118118
'rotor_diameter': 127, # in m
119119
'fetch_curve': 'power_curve' # fetch power curve
120120
}
121-
# initialise WindTurbine object
121+
# initialize WindTurbine object
122122
e126 = WindTurbine(**enerconE126)
123123

124124
return my_turbine, e126
@@ -147,7 +147,7 @@ def calculate_power_output(weather, my_turbine, e126):
147147
"""
148148

149149
# power output calculation for my_turbine
150-
# initialise ModelChain with default parameters and use run_model method
150+
# initialize ModelChain with default parameters and use run_model method
151151
# to calculate power output
152152
mc_my_turbine = ModelChain(my_turbine).run_model(weather)
153153
# write power output timeseries to WindTurbine object
@@ -168,7 +168,7 @@ def calculate_power_output(weather, my_turbine, e126):
168168
'density_correction': True, # False (default) or True
169169
'obstacle_height': 0, # default: 0
170170
'hellman_exp': None} # None (default) or None
171-
# initialise ModelChain with own specifications and use run_model method
171+
# initialize ModelChain with own specifications and use run_model method
172172
# to calculate power output
173173
mc_e126 = ModelChain(e126, **modelchain_data).run_model(weather)
174174
# write power output time series to WindTurbine object
@@ -233,7 +233,7 @@ def run_basic_example():
233233
234234
"""
235235
weather = get_weather_data('weather.csv')
236-
my_turbine, e126 = initialise_wind_turbines()
236+
my_turbine, e126 = initialize_wind_turbines()
237237
calculate_power_output(weather, my_turbine, e126)
238238
plot_or_print(my_turbine, e126)
239239

example/further_example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"weather = basic_example.get_weather_data('weather.csv')\n",
6565
"print(weather[['wind_speed', 'temperature', 'pressure']][0:3])\n",
6666
"\n",
67-
"# Initialize wind turbines\n",
67+
"# Initialise wind turbines\n",
6868
"my_turbine, e126 = basic_example.initialise_wind_turbines()\n",
6969
"print()\n",
7070
"print('nominal power of my_turbine: {}'.format(my_turbine.nominal_power))"
@@ -135,7 +135,7 @@
135135
"cell_type": "markdown",
136136
"metadata": {},
137137
"source": [
138-
"### Initialize wind turbine cluster\n",
138+
"### Initialise wind turbine cluster\n",
139139
"\n",
140140
"Like for a wind farm for the initialization of a wind turbine cluster you can use a dictionary that contains the basic parameters. A wind turbine cluster is defined by its name, wind farms and optionally by its location."
141141
]

example/further_example.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
logging.getLogger().setLevel(logging.DEBUG)
2828

2929

30-
def initialise_wind_farms(my_turbine, e126):
30+
def initialize_wind_farms(my_turbine, e126):
3131
r"""
32-
Initialises two :class:`~.wind_farm.WindFarm` objects.
32+
Initializes two :class:`~.wind_farm.WindFarm` objects.
3333
34-
This function shows how to initialise a WindFarm object. You need to
34+
This function shows how to initialize a WindFarm object. You need to
3535
provide at least a name and a the wind farm's wind turbine fleet as done
3636
below for 'example_farm'. Optionally you can provide a wind farm efficiency
3737
(which can be constant or dependent on the wind speed) and coordinates as
@@ -61,7 +61,7 @@ def initialise_wind_farms(my_turbine, e126):
6161
'number_of_turbines': 3}
6262
]}
6363

64-
# initialise WindFarm object
64+
# initialize WindFarm object
6565
example_farm = WindFarm(**example_farm_data)
6666

6767
# specification of wind farm data (2) containing a wind farm efficiency
@@ -75,17 +75,17 @@ def initialise_wind_farms(my_turbine, e126):
7575
'efficiency': 0.9,
7676
'coordinates': [52.2, 13.1]}
7777

78-
# initialise WindFarm object
78+
# initialize WindFarm object
7979
example_farm_2 = WindFarm(**example_farm_2_data)
8080

8181
return example_farm, example_farm_2
8282

8383

84-
def initialise_wind_turbine_cluster(example_farm, example_farm_2):
84+
def initialize_wind_turbine_cluster(example_farm, example_farm_2):
8585
r"""
86-
Initialises a :class:`~.wind_turbine_cluster.WindTurbineCluster` object.
86+
Initializes a :class:`~.wind_turbine_cluster.WindTurbineCluster` object.
8787
88-
Function shows how to initialise a WindTurbineCluster object. In this case
88+
Function shows how to initialize a WindTurbineCluster object. In this case
8989
the cluster only contains two wind farms.
9090
9191
Parameters
@@ -106,7 +106,7 @@ def initialise_wind_turbine_cluster(example_farm, example_farm_2):
106106
'name': 'example_cluster',
107107
'wind_farms': [example_farm, example_farm_2]}
108108

109-
# initialise WindTurbineCluster object
109+
# initialize WindTurbineCluster object
110110
example_cluster = WindTurbineCluster(**example_cluster_data)
111111

112112
return example_cluster
@@ -137,7 +137,7 @@ class that provides all necessary steps to calculate the power output of a
137137
# set efficiency of example_farm to apply wake losses
138138
example_farm.efficiency = 0.9
139139
# power output calculation for example_farm
140-
# initialise TurbineClusterModelChain with default parameters and use
140+
# initialize TurbineClusterModelChain with default parameters and use
141141
# run_model method to calculate power output
142142
mc_example_farm = TurbineClusterModelChain(example_farm).run_model(weather)
143143
# write power output time series to WindFarm object
@@ -172,7 +172,7 @@ class that provides all necessary steps to calculate the power output of a
172172
'density_correction': True, # False (default) or True
173173
'obstacle_height': 0, # default: 0
174174
'hellman_exp': None} # None (default) or None
175-
# initialise TurbineClusterModelChain with own specifications and use
175+
# initialize TurbineClusterModelChain with own specifications and use
176176
# run_model method to calculate power output
177177
mc_example_cluster = TurbineClusterModelChain(
178178
example_cluster, **modelchain_data).run_model(weather)
@@ -211,9 +211,9 @@ def run_example():
211211
212212
"""
213213
weather = basic_example.get_weather_data('weather.csv')
214-
my_turbine, e126 = basic_example.initialise_wind_turbines()
215-
example_farm, example_farm_2 = initialise_wind_farms(my_turbine, e126)
216-
example_cluster = initialise_wind_turbine_cluster(example_farm,
214+
my_turbine, e126 = basic_example.initialize_wind_turbines()
215+
example_farm, example_farm_2 = initialize_wind_farms(my_turbine, e126)
216+
example_cluster = initialize_wind_turbine_cluster(example_farm,
217217
example_farm_2)
218218
calculate_power_output(weather, example_farm, example_cluster)
219219
plot_or_print(example_farm, example_cluster)

example/test_examples.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TestExamples:
1414
def test_basic_example_flh(self):
1515
# tests full load hours
1616
weather = be.get_weather_data('weather.csv')
17-
my_turbine, e126 = be.initialise_wind_turbines()
17+
my_turbine, e126 = be.initialize_wind_turbines()
1818
be.calculate_power_output(weather, my_turbine, e126)
1919

2020
assert_allclose(1766.6870, (e126.power_output.sum() /
@@ -25,10 +25,10 @@ def test_basic_example_flh(self):
2525
def test_further_example_flh(self):
2626
# tests full load hours
2727
weather = be.get_weather_data('weather.csv')
28-
my_turbine, e126 = be.initialise_wind_turbines()
29-
example_farm, example_farm_2 = fe.initialise_wind_farms(my_turbine,
28+
my_turbine, e126 = be.initialize_wind_turbines()
29+
example_farm, example_farm_2 = fe.initialize_wind_farms(my_turbine,
3030
e126)
31-
example_cluster = fe.initialise_wind_turbine_cluster(example_farm,
31+
example_cluster = fe.initialize_wind_turbine_cluster(example_farm,
3232
example_farm_2)
3333
fe.calculate_power_output(weather, example_farm, example_cluster)
3434
assert_allclose(1586.23527, (example_farm.power_output.sum() /

0 commit comments

Comments
 (0)