Skip to content

Commit c1892d3

Browse files
committed
Rename examples according to modelchains
1 parent abd780d commit c1892d3

16 files changed

+127
-105
lines changed

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ Matplotlib can be installed using pip3 though some Linux users reported that it
4545
Examples and basic usage
4646
=========================
4747

48-
The basic usage of the windpowerlib is shown `here <http://windpowerlib.readthedocs.io/en/stable/basic_example_notebook.html>`_. The presented example is available as jupyter notebook and python script. You can download them along with example weather data:
48+
The basic usage of the windpowerlib is shown in the `modelchain_example <http://windpowerlib.readthedocs.io/en/stable/basic_example_notebook.html>`_. The presented example is available as jupyter notebook and python script. You can download them along with example weather data:
4949

50-
* `Basic example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/basic_example.py>`_
51-
* `Basic example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/features/revise_example/example/basic_example.ipynb>`_
50+
* `ModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/basic_example.py>`_
51+
* `ModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/features/revise_example/example/basic_example.ipynb>`_
5252
* `Example data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
5353

5454

5555
To run the examples you first have to install the windpowerlib. To run the notebook you also need to install notebook using pip3. To launch jupyter notebook type ``jupyter notebook`` in terminal.
5656
This will open a browser window. Navigate to the directory containing the notebook to open it. See the jupyter notebook quick start guide for more information on `how to install <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/install.html>`_ and
5757
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
5858

59-
The usage of further functions are shown in a second example. As the basic usage example it is available as jupyter notebook and as python script. The weather data in this example is the same as in the example above.
59+
Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in a second example. As the ModelChain example it is available as jupyter notebook and as python script. The weather data in this example is the same as in the example above.
6060

61-
* `Further example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/release_preparation/example/further_example.py>`_
62-
* `Further example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/release_preparation/example/basic_example.ipynb>`_
61+
* `TurbineClusterModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/release_preparation/example/further_example.py>`_
62+
* `TurbineClusterModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/release_preparation/example/basic_example.ipynb>`_
6363
* `Example data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
6464

6565

doc/example.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
.. autosummary::
44
:toctree: temp/
55

6-
basic_example.get_weather_data
7-
basic_example.initialize_wind_turbines
8-
basic_example.calculate_power_output
9-
basic_example.plot_or_print
10-
basic_example.run_basic_example
6+
modelchain_example.get_weather_data
7+
modelchain_example.initialize_wind_turbines
8+
modelchain_example.calculate_power_output
9+
modelchain_example.plot_or_print
10+
modelchain_example.run_example

doc/example_2.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
.. autosummary::
44
:toctree: temp/
55

6-
further_example.initialize_wind_farms
7-
further_example.initialize_wind_turbine_cluster
8-
further_example.calculate_power_output
9-
further_example.plot_or_print
10-
further_example.run_example
6+
turbine_cluster_modelchain_example.initialize_wind_farms
7+
turbine_cluster_modelchain_example.initialize_wind_turbine_cluster
8+
turbine_cluster_modelchain_example.calculate_power_output
9+
turbine_cluster_modelchain_example.plot_or_print
10+
turbine_cluster_modelchain_example.run_example

doc/examples.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#############
2+
Examples
3+
#############
4+
5+
6+
.. toctree::
7+
8+
modelchain_example_notebook
9+
turbine_cluster_modelchain_example_notebook

doc/examples_basic_and_further.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

doc/getting_started.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ Matplotlib can be installed using pip3 though some Linux users reported that it
4444
Examples and basic usage
4545
=========================
4646

47-
The basic usage of the windpowerlib is shown :ref:`here <basic_example_notebook.ipynb>`. The presented example is available as jupyter notebook and python script. You can download them along with example weather data:
47+
The basic usage of the windpowerlib is shown in the :ref:`modelchain_example <basic_example_notebook.ipynb>`. The presented example is available as jupyter notebook and python script. You can download them along with example weather data:
4848

49-
* :download:`Basic example (Python script) <../example/basic_example.py>`
50-
* :download:`Basic example (Jupyter notebook) <../example/basic_example.ipynb>`
49+
* :download:`ModelChain example (Python script) <../example/basic_example.py>`
50+
* :download:`ModelChain example (Jupyter notebook) <../example/basic_example.ipynb>`
5151
* :download:`Example data file <../example/weather.csv>`
5252

5353
To run the examples you first have to install the windpowerlib. To run the notebook you also need to install notebook using pip3. To launch jupyter notebook type ``jupyter notebook`` in terminal.
5454
This will open a browser window. Navigate to the directory containing the notebook to open it. See the jupyter notebook quick start guide for more information on `how to install <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/install.html>`_ and
5555
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
5656

57-
Further functionalities are shown in a second example. As the basic usage example it is available as jupyter notebook and as python script. The weather data in this example is the same as in the example above.
57+
Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in a second example. As the ModelChain example it is available as jupyter notebook and as python script. The weather data in this example is the same as in the example above.
5858

59-
* :download:`Further example (Python script) <../example/further_example.py>`
60-
* :download:`Further example (Jupyter notebook) <../example/further_example.ipynb>`
59+
* :download:`TurbineClusterModelChain example (Python script) <../example/further_example.py>`
60+
* :download:`TurbineClusterModelChain example (Jupyter notebook) <../example/further_example.ipynb>`
6161
* :download:`Example data file <../example/weather.csv>`
6262

6363
Contributing

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Contents:
88
:glob:
99

1010
getting_started
11-
examples_basic_and_further
11+
examples
1212
whats_new
1313
modules
1414

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Basic usage\n",
7+
"# ModelChain example\n",
88
"\n",
9-
"This example shows you the basic usage of the windpowerlib. \n",
10-
"There are mainly three steps. First you have to import your weather data, then you need to specify your wind turbine, and in the last step call the windpowerlib functions to calculate the feedin time series.\n",
9+
"This example shows you the basic usage of the windpowerlib by using the ``ModelChain`` class.\n",
10+
"There are mainly three steps. First you have to import your weather data, then you need to specify your wind turbine, and in the last step call the windpowerlib functions to calculate the feed-in time series.\n",
1111
"\n",
1212
"Before you start you have to import the packages needed for these steps."
1313
]

doc/modules.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,17 @@ Additional functions used in the windpowerlib.
193193
tools.estimate_turbulence_intensity
194194

195195

196-
Basic example
197-
==============
196+
ModelChain example
197+
==================
198198

199-
The basic example consists of the following functions.
199+
The ``modelchain_example`` consists of the following functions.
200200

201201
.. include:: example.rst
202202

203-
Further example
204-
===============
203+
TurbineClusterModelChain example
204+
================================
205205

206-
A further example consists of the following functions as well as uses functions
207-
of the basic example.
206+
The ``turbine_cluster_modelchain_example`` consists of the following functions
207+
as well as it uses functions of the ``modelchain_example``.
208208

209209
.. include:: example_2.rst

example/further_example.ipynb renamed to doc/turbine_cluster_modelchain_example_notebook.ipynb

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Further usage\n",
7+
"# TurbineClusterModelChain example\n",
88
"\n",
9-
"This example shows you the further usage of the windpowerlib. Functions that are used in the basic usage example, like the initialization of wind turbines, are imported and used without further explanations.\n",
9+
"This example shows you how to calculate the power output of wind farms and wind turbine clusters with the windpowerlib. A cluster can be useful if you want to calculate the feed-in of a region for which you want to use one single weather data point.\n",
1010
"\n",
11-
"In this example the power output of a wind farm containing two different wind turbine types is calulated. Apart from that, this example shows you how to calculate the power output of a wind turbine cluster. A cluster can be useful if you want to calculate the feed-in of a region for which you want to use one single weather data grid point."
11+
"Functions that are used in the ModelChain example, like the initialization of wind turbines, are imported and used without further explanations."
1212
]
1313
},
1414
{
@@ -17,19 +17,19 @@
1717
"source": [
1818
"### Imports and initialization of wind turbines\n",
1919
"\n",
20-
"The import of weather data and the initialization of wind turbines is done as in the basic_example."
20+
"The import of weather data and the initialization of wind turbines is done as in the ``modelchain_example``."
2121
]
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 6,
25+
"execution_count": 1,
2626
"metadata": {},
2727
"outputs": [],
2828
"source": [
2929
"__copyright__ = \"Copyright oemof developer group\"\n",
3030
"__license__ = \"GPLv3\"\n",
3131
"\n",
32-
"import basic_example\n",
32+
"import modelchain_example as mc_e\n",
3333
"from windpowerlib.turbine_cluster_modelchain import TurbineClusterModelChain\n",
3434
"from windpowerlib.wind_turbine_cluster import WindTurbineCluster\n",
3535
"from windpowerlib.wind_farm import WindFarm\n",
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": 7,
43+
"execution_count": 2,
4444
"metadata": {},
4545
"outputs": [
4646
{
@@ -59,11 +59,11 @@
5959
],
6060
"source": [
6161
"# Get weather data\n",
62-
"weather = basic_example.get_weather_data('weather.csv')\n",
62+
"weather = mc_e.get_weather_data('weather.csv')\n",
6363
"print(weather[['wind_speed', 'temperature', 'pressure']][0:3])\n",
6464
"\n",
6565
"# Initialize wind turbines\n",
66-
"my_turbine, e126 = basic_example.initialize_wind_turbines()\n",
66+
"my_turbine, e126 = mc_e.initialize_wind_turbines()\n",
6767
"print()\n",
6868
"print('nominal power of my_turbine: {}'.format(my_turbine.nominal_power))"
6969
]
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"cell_type": "code",
84-
"execution_count": 8,
84+
"execution_count": 3,
8585
"metadata": {},
8686
"outputs": [],
8787
"source": [
@@ -100,7 +100,7 @@
100100
},
101101
{
102102
"cell_type": "code",
103-
"execution_count": 9,
103+
"execution_count": 4,
104104
"metadata": {},
105105
"outputs": [
106106
{
@@ -141,7 +141,7 @@
141141
},
142142
{
143143
"cell_type": "code",
144-
"execution_count": 10,
144+
"execution_count": 5,
145145
"metadata": {},
146146
"outputs": [],
147147
"source": [
@@ -169,7 +169,7 @@
169169
},
170170
{
171171
"cell_type": "code",
172-
"execution_count": 11,
172+
"execution_count": 6,
173173
"metadata": {},
174174
"outputs": [
175175
{
@@ -194,7 +194,7 @@
194194
},
195195
{
196196
"cell_type": "code",
197-
"execution_count": 12,
197+
"execution_count": 7,
198198
"metadata": {},
199199
"outputs": [
200200
{
@@ -262,7 +262,7 @@
262262
},
263263
{
264264
"cell_type": "code",
265-
"execution_count": 13,
265+
"execution_count": 8,
266266
"metadata": {},
267267
"outputs": [
268268
{
@@ -285,7 +285,7 @@
285285
},
286286
{
287287
"cell_type": "code",
288-
"execution_count": 14,
288+
"execution_count": 9,
289289
"metadata": {},
290290
"outputs": [
291291
{
@@ -319,6 +319,13 @@
319319
" example_farm.power_output.plot(legend=True, label='example farm')\n",
320320
" plt.show()"
321321
]
322+
},
323+
{
324+
"cell_type": "code",
325+
"execution_count": null,
326+
"metadata": {},
327+
"outputs": [],
328+
"source": []
322329
}
323330
],
324331
"metadata": {

0 commit comments

Comments
 (0)