Skip to content

Commit 4c05066

Browse files
committed
Merge branch 'master' into dev
2 parents e4811c0 + 529b27f commit 4c05066

20 files changed

+298
-258
lines changed

README.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
:target: https://travis-ci.org/wind-python/windpowerlib
33
.. image:: https://coveralls.io/repos/github/wind-python/windpowerlib/badge.svg?branch=dev
44
:target: https://coveralls.io/github/wind-python/windpowerlib?branch=dev
5-
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.824268.svg
6-
:target: https://doi.org/10.5281/zenodo.824268
7-
5+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2542896.svg
6+
:target: https://doi.org/10.5281/zenodo.2542896
7+
88
Introduction
99
=============
1010

@@ -35,6 +35,8 @@ If you have a working Python 3 environment, use pypi to install the latest windp
3535
The windpowerlib is designed for Python 3 and tested on Python >= 3.5.
3636
Please see the `installation page <http://oemof.readthedocs.io/en/stable/installation_and_setup.html>`_ of the oemof documentation for complete instructions on how to install python and a virtual environment on your operating system.
3737

38+
For retrieving power (coefficient) curves from the OpenEnergy Database (oedb) the python package requests will be installed with your windpowerlib installation. The windpowerlib was tested with requests version 2.20.1 but might work with lower versions.
39+
3840
Optional Packages
3941
~~~~~~~~~~~~~~~~~
4042

@@ -47,24 +49,20 @@ Matplotlib can be installed using pip3 though some Linux users reported that it
4749
Examples and basic usage
4850
=========================
4951

50-
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:
52+
The basic usage of the windpowerlib is shown in the `modelchain_example <http://windpowerlib.readthedocs.io/en/stable/modelchain_example_notebook.html>`_. The presented example is available as jupyter notebook and python script. You can download them along with example weather data:
5153

52-
* `ModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/basic_example.py>`_
53-
* `ModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/features/revise_example/example/basic_example.ipynb>`_
54+
* `ModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.py>`_
55+
* `ModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.ipynb>`_
5456
* `Example data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
5557

56-
5758
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.
5859
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
5960
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
6061

61-
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.
62-
63-
* `TurbineClusterModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/release_preparation/example/further_example.py>`_
64-
* `TurbineClusterModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/release_preparation/example/basic_example.ipynb>`_
65-
* `Example data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
62+
Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in the `turbine_cluster_modelchain_example <http://windpowerlib.readthedocs.io/en/stable/turbine_cluster_modelchain_example_notebook.html>`_. 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.
6663

67-
You can also look at the examples in the `Examples <https://windpowerlib.readthedocs.io/en/latest/examples.html>`_ section.
64+
* `TurbineClusterModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.py>`_
65+
* `TurbineClusterModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.ipynb>`_
6866

6967
Contributing
7068
==============

doc/getting_started.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ If you have a working Python 3 environment, use pypi to install the latest windp
3232
The windpowerlib is designed for Python 3 and tested on Python >= 3.5.
3333
Please see the `installation page <http://oemof.readthedocs.io/en/stable/installation_and_setup.html>`_ of the oemof documentation for complete instructions on how to install python and a virtual environment on your operating system.
3434

35+
For retrieving power (coefficient) curves from the OpenEnergy Database (oedb) the python package requests will be installed with your windpowerlib installation. The windpowerlib was tested with requests version 2.20.1 but might work with lower versions.
36+
3537
Optional Packages
3638
~~~~~~~~~~~~~~~~~
3739

@@ -54,11 +56,10 @@ To run the examples you first have to install the windpowerlib. To run the noteb
5456
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
5557
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
5658

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.
59+
Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in the TurbineClusterModelChain 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.
5860

5961
* :download:`TurbineClusterModelChain example (Python script) <../example/turbine_cluster_modelchain_example.py>`
6062
* :download:`TurbineClusterModelChain example (Jupyter notebook) <../example/turbine_cluster_modelchain_example.ipynb>`
61-
* :download:`Example data file <../example/weather.csv>`
6263

6364
You can also look at the examples in the :ref:`examples_section_label` section.
6465

doc/modelchain_example_notebook.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@
188188
"12 Enercon E-82/2350 True True\n",
189189
"13 Enercon E-82/3000 True True\n",
190190
"14 Enercon E-92/2350 True True\n",
191-
"15 Enercon E48/800 True True\n"
191+
"15 Enercon E/126/7500 True False\n",
192+
"16 Enercon E48/800 True True\n"
192193
]
193194
}
194195
],
@@ -256,7 +257,7 @@
256257
"DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): oep.iks.cs.ovgu.de:80\n",
257258
"DEBUG:urllib3.connectionpool:http://oep.iks.cs.ovgu.de:80 \"GET //api/v0/schema/model_draft/tables/openfred_windpower_powercurve/rows/ HTTP/1.1\" 301 438\n",
258259
"DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): openenergy-platform.org:80\n",
259-
"DEBUG:urllib3.connectionpool:http://openenergy-platform.org:80 \"GET /api/v0/schema/model_draft/tables/openfred_windpower_powercurve/rows/ HTTP/1.1\" 200 149329\n",
260+
"DEBUG:urllib3.connectionpool:http://openenergy-platform.org:80 \"GET /api/v0/schema/model_draft/tables/openfred_windpower_powercurve/rows/ HTTP/1.1\" 200 150623\n",
260261
"INFO:root:Data base connection successful.\n"
261262
]
262263
}
@@ -284,12 +285,13 @@
284285
"source": [
285286
"# specification of wind turbine where power coefficient curve is provided\n",
286287
"# by a csv file\n",
288+
"source = 'data/example_power_coefficient_curves.csv'\n",
287289
"dummy_turbine = {\n",
288290
" 'name': 'DUMMY 1', # turbine type as in file #\n",
289291
" 'hub_height': 100, # in m\n",
290292
" 'rotor_diameter': 70, # in m\n",
291293
" 'fetch_curve': 'power_coefficient_curve', # fetch cp curve #\n",
292-
" 'data_source': 'example_power_coefficient_curves.csv' # data source\n",
294+
" 'data_source': source # data source\n",
293295
"}\n",
294296
"# initialize WindTurbine object\n",
295297
"dummy_turbine = WindTurbine(**dummy_turbine)"

doc/modules.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ power curve or power coefficient curve needed by the :py:class:`~.wind_turbine.W
6868
:toctree: temp/
6969

7070
wind_turbine.WindTurbine.fetch_turbine_data
71+
wind_turbine.get_turbine_data_from_file
72+
wind_turbine.get_turbine_data_from_oedb
73+
wind_turbine.load_turbine_data_from_oedb
7174
wind_turbine.get_turbine_types
72-
wind_turbine.read_turbine_data
7375

7476
.. _wind_farm_label:
7577

@@ -196,6 +198,7 @@ Methods of the TurbineClusterModelChain object.
196198
.. autosummary::
197199
:toctree: temp/
198200

201+
turbine_cluster_modelchain.TurbineClusterModelChain.assign_power_curve
199202
turbine_cluster_modelchain.TurbineClusterModelChain.temperature_hub
200203
turbine_cluster_modelchain.TurbineClusterModelChain.density_hub
201204
turbine_cluster_modelchain.TurbineClusterModelChain.wind_speed_hub

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ sphinx>=1.4
22
ipykernel
33
nbsphinx
44
pandas
5-
numpy
5+
requests

doc/whatsnew/v0-1-0.txt

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1-
v0.1.0 (January 16, 2019)
1+
v0.1.0 (January 17, 2019)
22
++++++++++++++++++++++++++++++++++
33

4+
ATTENTION: From v0.1.0 on power (coefficient) curves are provided by the `OpenEnergy Database (oedb) <https://openenergy-platform.org/dataedit/>`_
5+
instead of in csv files (v0.6.0 and lower) due to legal reasons.
6+
Use :py:func:`~windpowerlib.wind_turbine.get_turbine_types` to check whether the turbine types you need are included in the database.
7+
If your turbine type is not included you can either use your own csv file or open an issue.
8+
49
New classes
510
###########
611

7-
* WindFarm class for modelling a wind farm. Defines a standard set of wind farm attributes, for example aggregated power curve and wind farm efficiency to take wake losses into account.
8-
* WindTurbineCluster class for modelling a turbine cluster that contains several wind turbines and/or wind farms. This class is useful for gathering all wind turbines in a weather data grid cell. An aggregated power curve can be calculated which considers the wake losses of the wind farms by a set efficiency if desired.
9-
* TurbineClusterModelChain class shows the usage of new functions and classes of windpowerlib v.0.1 and is based on the ModelChain class.
12+
* :class:`~windpowerlib.wind_farm.WindFarm` class for modelling a wind farm. Defines a standard set of wind farm attributes, for example aggregated power curve and wind farm efficiency to take wake losses into account.
13+
* :class:`~windpowerlib.wind_turbine_cluster.WindTurbineCluster` class for modelling a turbine cluster that contains several wind turbines and/or wind farms. This class is useful for gathering all wind turbines in a weather data grid cell. An aggregated power curve can be calculated which considers the wake losses of the wind farms by a set efficiency if desired.
14+
* :class:`~windpowerlib.turbine_cluster_modelchain.TurbineClusterModelChain` class shows the usage of new functions and classes of windpowerlib v.0.1 and is based on the ModelChain class.
1015

1116
New functions
1217
#############
1318

14-
* power curve smoothing for taking into account the spatial distribution of wind speed
15-
* application of wake losses to a power curve
16-
* application of wake losses to a wind speed time series by using wind efficiency curves which are provided in the data directory
17-
* logarithmic interpolation/extrapolation for wind speed time series
18-
* gauss distribution
19-
* estimation of turbulence intensity by roughness length
20-
* retrieve power curves from Open Energy Database
19+
* :py:func:`~windpowerlib.power_curves.smooth_power_curve` for taking into account the spatial distribution of wind speed
20+
* :py:func:`~windpowerlib.power_curves.wake_losses_to_power_curve`: application of wake losses to a power curve
21+
* :py:func:`~windpowerlib.wake_losses.reduce_wind_speed`: application of wake losses to a wind speed time series by using wind efficiency curves which are provided in the data directory
22+
* :py:func:`~windpowerlib.tools.logarithmic_interpolation_extrapolation` for wind speed time series
23+
* :py:func:`~windpowerlib.tools.gauss_distribution` needed for power curve smoothing
24+
* :py:func:`~windpowerlib.tools.estimate_turbulence_intensity` by roughness length
25+
* :py:func:`~windpowerlib.wind_turbine.get_turbine_data_from_oedb` for retrieving power curves from `OpenEnergy Database <https://openenergy-platform.org/dataedit/>`_
2126

2227

2328
Testing
@@ -36,10 +41,10 @@ Documentation
3641
API changes
3742
###########
3843

39-
* renamed attribute 'turbine_name' of WindTurbine object to 'name' to match with 'name' attribute of WindFarm and WindTurbineCluster
44+
* renamed attribute `turbine_name` of WindTurbine class to `name` to match with `name` attribute of WindFarm and WindTurbineCluster class
4045
* renamed `basic_example` to `modelchain_example`
41-
* renamed column 'values' of power curves to 'power' and column 'values' of power coefficient curves to 'power coefficient'
42-
* renamed `run_basic_example()` to `run_example()`
46+
* renamed column 'values' of power (coefficient) curves to 'value' to prevent errors using df.value(s)
47+
* renamed `run_basic_example()` to `run_example()` in `modelchain_example`
4348
* renamed parameter `wind_turbine` of `ModelChain` object to `power_plant`
4449
* removed parameter `density_correction` from `power_plant.power_coefficient()`
4550

File renamed without changes.
File renamed without changes.

example/modelchain_example.ipynb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@
188188
"12 Enercon E-82/2350 True True\n",
189189
"13 Enercon E-82/3000 True True\n",
190190
"14 Enercon E-92/2350 True True\n",
191-
"15 Enercon E48/800 True True\n"
191+
"15 Enercon E/126/7500 True False\n",
192+
"16 Enercon E48/800 True True\n"
192193
]
193194
}
194195
],
@@ -236,7 +237,7 @@
236237
" 'hub_height': 105, # in m\n",
237238
" 'rotor_diameter': 90, # in m\n",
238239
" 'power_curve': pd.DataFrame(\n",
239-
" data={'power': [p * 1000 for p in [\n",
240+
" data={'value': [p * 1000 for p in [\n",
240241
" 0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W\n",
241242
" 'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s\n",
242243
" } \n",
@@ -256,7 +257,7 @@
256257
"DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): oep.iks.cs.ovgu.de:80\n",
257258
"DEBUG:urllib3.connectionpool:http://oep.iks.cs.ovgu.de:80 \"GET //api/v0/schema/model_draft/tables/openfred_windpower_powercurve/rows/ HTTP/1.1\" 301 438\n",
258259
"DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): openenergy-platform.org:80\n",
259-
"DEBUG:urllib3.connectionpool:http://openenergy-platform.org:80 \"GET /api/v0/schema/model_draft/tables/openfred_windpower_powercurve/rows/ HTTP/1.1\" 200 149329\n",
260+
"DEBUG:urllib3.connectionpool:http://openenergy-platform.org:80 \"GET /api/v0/schema/model_draft/tables/openfred_windpower_powercurve/rows/ HTTP/1.1\" 200 150623\n",
260261
"INFO:root:Data base connection successful.\n"
261262
]
262263
}
@@ -284,12 +285,13 @@
284285
"source": [
285286
"# specification of wind turbine where power coefficient curve is provided\n",
286287
"# by a csv file\n",
288+
"source = 'data/example_power_coefficient_curves.csv'\n",
287289
"dummy_turbine = {\n",
288290
" 'name': 'DUMMY 1', # turbine type as in file #\n",
289291
" 'hub_height': 100, # in m\n",
290292
" 'rotor_diameter': 70, # in m\n",
291293
" 'fetch_curve': 'power_coefficient_curve', # fetch cp curve #\n",
292-
" 'data_source': 'example_power_coefficient_curves.csv' # data source\n",
294+
" 'data_source': source # data source\n",
293295
"}\n",
294296
"# initialize WindTurbine object\n",
295297
"dummy_turbine = WindTurbine(**dummy_turbine)"
@@ -523,20 +525,20 @@
523525
"if plt:\n",
524526
" if e126.power_coefficient_curve is not None:\n",
525527
" e126.power_coefficient_curve.plot(\n",
526-
" x='wind_speed', y='power coefficient', style='*',\n",
528+
" x='wind_speed', y='value', style='*',\n",
527529
" title='Enercon E126 power coefficient curve')\n",
528530
" plt.show()\n",
529531
" if e126.power_curve is not None:\n",
530-
" e126.power_curve.plot(x='wind_speed', y='power', style='*',\n",
532+
" e126.power_curve.plot(x='wind_speed', y='value', style='*',\n",
531533
" title='Enercon E126 power curve')\n",
532534
" plt.show()\n",
533535
" if my_turbine.power_coefficient_curve is not None:\n",
534536
" my_turbine.power_coefficient_curve.plot(\n",
535-
" x='wind_speed', y='power coefficient', style='*',\n",
537+
" x='wind_speed', y='value', style='*',\n",
536538
" title='myTurbine power coefficient curve')\n",
537539
" plt.show()\n",
538540
" if my_turbine.power_curve is not None:\n",
539-
" my_turbine.power_curve.plot(x='wind_speed', y='power', style='*',\n",
541+
" my_turbine.power_curve.plot(x='wind_speed', y='value', style='*',\n",
540542
" title='myTurbine power curve')\n",
541543
" plt.show()"
542544
]

0 commit comments

Comments
 (0)