Skip to content

Commit e911470

Browse files
committed
Merge branch 'dev'
2 parents c83b416 + 70755f9 commit e911470

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2037
-1318
lines changed

.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ pip-delete-this-directory.txt
3636

3737
# Doc
3838
doc/temp/*
39-
!doc/temp/windpowerlib.wind_farm.WindFarm.rst
40-
!doc/temp/windpowerlib.wind_turbine_cluster.WindTurbineCluster.rst
4139
.doctrees
4240
.buildinfo
4341

@@ -98,8 +96,3 @@ ENV/
9896

9997
# tests
10098
.pytest_cache
101-
102-
# oedb data dump
103-
/windpowerlib/data/turbine_data_oedb.h5
104-
/windpowerlib/data/oedb_power_coefficient_curves.csv
105-
/windpowerlib/data/oedb_power_curves.csv

README.rst

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,71 @@ Go to the `download page <http://readthedocs.org/projects/windpowerlib/downloads
2626
Installation
2727
============
2828

29-
If you have a working Python 3 environment, use pypi to install the latest windpowerlib version. We highly recommend to use virtual environments.
29+
If you have a working Python 3 environment, use pypi to install the latest windpowerlib version:
3030

3131
::
3232

3333
pip install windpowerlib
3434

35-
The windpowerlib is designed for Python 3 and tested on Python >= 3.5.
35+
The windpowerlib is designed for Python 3 and tested on Python >= 3.5. We highly recommend to use virtual environments.
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-
4038
Optional Packages
4139
~~~~~~~~~~~~~~~~~
4240

4341
To see the plots of the windpowerlib example in the `Examples and basic usage <http://windpowerlib.readthedocs.io/en/stable/getting_started.html#examplereference-label>`_ section you should `install the matplotlib package <http://matplotlib.org/users/installing.html>`_.
44-
Matplotlib can be installed using pip3 though some Linux users reported that it is easier and more stable to use the pre-built packages of your Linux distribution.
42+
Matplotlib can be installed using pip:
43+
44+
::
4545

46+
pip install matplotlib
4647

4748
.. _examplereference-label:
4849

4950
Examples and basic usage
5051
=========================
5152

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:
53+
The basic usage of the windpowerlib is shown in the `ModelChain example <http://windpowerlib.readthedocs.io/en/stable/modelchain_example_notebook.html>`_ that is available as jupyter notebook and python script:
5354

5455
* `ModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.py>`_
5556
* `ModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/modelchain_example.ipynb>`_
56-
* `Example data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
5757

58-
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.
58+
To run the example you need the example weather and turbine data used:
59+
60+
* `Example weather data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/weather.csv>`_
61+
* `Example power curve data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_power_curves.csv>`_
62+
* `Example power coefficient curve data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_power_coefficient_curves.csv>`_
63+
* `Example nominal power data file <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/data/example_turbine_data.csv>`_
64+
65+
Furthermore, you 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 the terminal.
5966
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
6067
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
6168

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.
69+
Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in the `TurbineClusterModelChain 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 and turbine datadata used in this example is the same as in the example above.
6370

6471
* `TurbineClusterModelChain example (Python script) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.py>`_
6572
* `TurbineClusterModelChain example (Jupyter notebook) <https://raw.githubusercontent.com/wind-python/windpowerlib/master/example/turbine_cluster_modelchain_example.ipynb>`_
6673

74+
You can also look at the examples in the `Example <http://windpowerlib.readthedocs.io/en/stable/examples.html>`_ section.
75+
76+
Wind turbine data
77+
==================
78+
79+
The windpowerlib provides `wind turbine data <https://github.com/wind-python/windpowerlib/tree/master/windpowerlib/oedb>`_
80+
(power curves, hub heights, etc.) for a large set of wind turbines. Have a look at the `example <http://windpowerlib.readthedocs.io/en/stable/modelchain_example_notebook.html#Initialize-wind-turbine>`_ on how
81+
to use this data in your simulations.
82+
83+
The dataset is hosted and maintained on the `OpenEnergy database <https://openenergy-platform.org/dataedit/>`_ (oedb).
84+
To update your local files with the latest version of the `oedb turbine library <https://openenergy-platform.org/dataedit/view/supply/wind_turbine_library>`_ you can execute the following in your python console:
85+
86+
.. code:: python
87+
88+
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
89+
load_turbine_data_from_oedb()
90+
91+
We would like to encourage anyone to contribute to the turbine library by adding turbine data or reporting errors in the data.
92+
See `here <https://github.com/OpenEnergyPlatform/data-preprocessing/issues/28>`_ for more information on how to contribute.
93+
6794
Contributing
6895
==============
6996

@@ -100,7 +127,6 @@ As the windpowerlib started with contributors from the `oemof developer group <h
100127
101128
pytest
102129
103-
104130
Citing the windpowerlib
105131
========================
106132

@@ -109,7 +135,7 @@ We use the zenodo project to get a DOI for each version. `Search zenodo for the
109135
License
110136
============
111137

112-
Copyright (C) 2017 oemof developing group
138+
Copyright (C) 2017 oemof developer group
113139

114140
This program is free software: you can redistribute it and/or modify
115141
it under the terms of the GNU General Public License as published by
@@ -122,4 +148,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
122148
GNU General Public License for more details.
123149

124150
You should have received a copy of the GNU General Public License
125-
along with this program. If not, see http://www.gnu.org/licenses/.
151+
along with this program. If not, see http://www.gnu.org/licenses/.

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
# Add any paths that contain custom static files (such as style sheets) here,
158158
# relative to this directory. They are copied after the builtin static files,
159159
# so a file named "default.css" will overwrite the builtin "default.css".
160-
html_static_path = ['_static']
160+
html_static_path = []
161161

162162
# Add any extra paths that contain custom files (such as robots.txt or
163163
# .htaccess) here, relative to this directory. These files are copied

doc/getting_started.rst

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,71 @@ Go to the `download page <http://readthedocs.org/projects/windpowerlib/downloads
2323
Installation
2424
============
2525

26-
If you have a working Python 3 environment, use pypi to install the latest windpowerlib version. We highly recommend to use virtual environments.
26+
If you have a working Python 3 environment, use pypi to install the latest windpowerlib version:
2727

2828
::
2929

3030
pip install windpowerlib
3131

32-
The windpowerlib is designed for Python 3 and tested on Python >= 3.5.
32+
The windpowerlib is designed for Python 3 and tested on Python >= 3.5. We highly recommend to use virtual environments.
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-
3735
Optional Packages
3836
~~~~~~~~~~~~~~~~~
3937

4038
To see the plots of the windpowerlib example in the :ref:`examplereference-label` section you should `install the matplotlib package <http://matplotlib.org/users/installing.html>`_.
41-
Matplotlib can be installed using pip3 though some Linux users reported that it is easier and more stable to use the pre-built packages of your Linux distribution.
39+
Matplotlib can be installed using pip:
40+
41+
::
4242

43+
pip install matplotlib
4344

4445
.. _examplereference-label:
4546

4647
Examples and basic usage
4748
=========================
4849

49-
The basic usage of the windpowerlib is shown in the ModelChain example. The presented example is available as jupyter notebook and python script. You can download them along with example weather data:
50+
The basic usage of the windpowerlib is shown in the ModelChain example that is available as jupyter notebook and python script:
5051

5152
* :download:`ModelChain example (Python script) <../example/modelchain_example.py>`
5253
* :download:`ModelChain example (Jupyter notebook) <../example/modelchain_example.ipynb>`
53-
* :download:`Example data file <../example/weather.csv>`
5454

55-
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.
55+
To run the example you need the example weather and turbine data used:
56+
57+
* :download:`Example weather data file <../example/weather.csv>`
58+
* :download:`Example power curve data file <../example/data/power_curves.csv>`
59+
* :download:`Example power coefficient curve data file <../example/data/power_coefficient_curves.csv>`
60+
* :download:`Example nominal power data file <../example/data/turbine_data.csv>`
61+
62+
Furthermore, you have to install the windpowerlib and to run the notebook you also need to install `notebook` using pip3. To launch jupyter notebook type ``jupyter notebook`` in the terminal.
5663
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
5764
`how to run <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html>`_ jupyter notebooks.
5865

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.
66+
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 and turbine data in this example is the same as in the example above.
6067

6168
* :download:`TurbineClusterModelChain example (Python script) <../example/turbine_cluster_modelchain_example.py>`
6269
* :download:`TurbineClusterModelChain example (Jupyter notebook) <../example/turbine_cluster_modelchain_example.ipynb>`
6370

6471
You can also look at the examples in the :ref:`examples_section_label` section.
6572

73+
Wind turbine data
74+
==================
75+
76+
The windpowerlib provides `wind turbine data <https://github.com/wind-python/windpowerlib/tree/master/windpowerlib/oedb>`_
77+
(power curves, hub heights, etc.) for a large set of wind turbines. See `Initialize wind turbine` in :ref:`examples_section_label` on how
78+
to use this data in your simulations.
79+
80+
The dataset is hosted and maintained on the `OpenEnergy database <https://openenergy-platform.org/dataedit/>`_ (oedb).
81+
To update your local files with the latest version of the `oedb turbine library <https://openenergy-platform.org/dataedit/view/supply/wind_turbine_library>`_ you can execute the following in your python console:
82+
83+
.. code:: python
84+
85+
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
86+
load_turbine_data_from_oedb()
87+
88+
We would like to encourage anyone to contribute to the turbine library by adding turbine data or reporting errors in the data.
89+
See `here <https://github.com/OpenEnergyPlatform/data-preprocessing/issues/28v>`_ for more information on how to contribute.
90+
6691
Contributing
6792
==============
6893

@@ -107,7 +132,7 @@ We use the zenodo project to get a DOI for each version. `Search zenodo for the
107132
License
108133
============
109134

110-
Copyright (C) 2017 oemof developing group
135+
Copyright (C) 2017 oemof developer group
111136

112137
This program is free software: you can redistribute it and/or modify
113138
it under the terms of the GNU General Public License as published by

doc/modules.rst

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,26 @@ Wind turbine data
6363
Functions and methods to obtain the nominal power as well as
6464
power curve or power coefficient curve needed by the :py:class:`~.wind_turbine.WindTurbine` class.
6565

66-
6766
.. autosummary::
6867
:toctree: temp/
6968

70-
wind_turbine.WindTurbine.fetch_turbine_data
7169
wind_turbine.get_turbine_data_from_file
72-
wind_turbine.get_turbine_data_from_oedb
7370
wind_turbine.load_turbine_data_from_oedb
7471
wind_turbine.get_turbine_types
7572

73+
.. _create_input_types_label:
74+
75+
Data Container
76+
=====================
77+
78+
Create data container to be used as an input in classes und functions.
79+
80+
.. autosummary::
81+
:toctree: temp/
82+
83+
wind_turbine.WindTurbineGroup
84+
wind_turbine.WindTurbine.to_group
85+
7686
.. _wind_farm_label:
7787

7888
Wind farm calculations
@@ -85,25 +95,26 @@ as the aggregated power curve of a :py:class:`~.wind_farm.WindFarm` object.
8595
.. autosummary::
8696
:toctree: temp/
8797

98+
wind_farm.WindFarm.check_and_complete_wind_turbine_fleet
99+
wind_farm.WindFarm.nominal_power
88100
wind_farm.WindFarm.mean_hub_height
89-
wind_farm.WindFarm.get_installed_power
90101
wind_farm.WindFarm.assign_power_curve
91102

92103
.. _wind_turbine_cluster_label:
93104

94105
Wind turbine cluster calculations
95106
=================================
96107

97-
Functions and methods to calculate the mean hub height, installed power as well
108+
Functions and methods to calculate the mean hub height, nominal power as well
98109
as the aggregated power curve of a :py:class:`~.wind_turbine_cluster.WindTurbineCluster` object.
99110
This is realized in a new module as the functions differ from the functions in
100111
the :py:class:`~.wind_farm.WindFarm` class.
101112

102113
.. autosummary::
103114
:toctree: temp/
104115

116+
wind_turbine_cluster.WindTurbineCluster.nominal_power
105117
wind_turbine_cluster.WindTurbineCluster.mean_hub_height
106-
wind_turbine_cluster.WindTurbineCluster.get_installed_power
107118
wind_turbine_cluster.WindTurbineCluster.assign_power_curve
108119

109120
.. _poweroutput_module_label:
@@ -234,4 +245,4 @@ TurbineClusterModelChain example
234245
The ``turbine_cluster_modelchain_example`` consists of the following functions
235246
as well as it uses functions of the ``modelchain_example``.
236247

237-
.. include:: example_2.rst
248+
.. include:: example_2.rst

doc/temp/windpowerlib.wind_farm.WindFarm.rst

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

doc/temp/windpowerlib.wind_turbine_cluster.WindTurbineCluster.rst

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

doc/whatsnew/v0-2-0.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
v0.2.0 (September 9, 2019)
2+
++++++++++++++++++++++++++++++
3+
4+
API changes
5+
#############
6+
* The :class:`~windpowerlib.wind_turbine.WindTurbine` API has been revised. Main changes are that the parameters `fetch_curve` and `data_source` have been removed.
7+
These parameters were formerly used to specify whether the power or power coefficient curve should be retrieved and the source to retrieve them from.
8+
Now per default the power curve and/or power coefficient curve are tried to be retrieved from the oedb turbine library that is provided along with the windpowerlib
9+
and holds turbine data for a large set of wind turbines. Further important changes are the renaming of the parameter `name` to `turbine_type` and the removal
10+
of the `coordinates`.
11+
See the :class:`~windpowerlib.wind_turbine.WindTurbine` docstring and `Initialize wind turbine` in the :ref:`examples_section_label` section for more information.
12+
(`PR 62 <https://github.com/wind-python/windpowerlib/pull/62>`)
13+
* The :class:`~windpowerlib.wind_farm.WindFarm` API has been revised. The `wind_turbine_fleet` parameter can now be provided as a pandas DataFrame
14+
(`PR 63 <https://github.com/wind-python/windpowerlib/pull/63>`_) or as a list using the :func:`~windpowerlib.wind_turbine.WindTurbine.to_group` method
15+
(`PR 68 <https://github.com/wind-python/windpowerlib/pull/68>`_. Furthermore, the option to specify the wind turbine fleet using the total installed capacity
16+
of each turbine type has been added. See the :class:`~windpowerlib.wind_farm.WindFarm` docstring and `Initialize wind farm` in the :ref:`examples_section_label` section for more information.
17+
* get_installed_power() methods in :class:`~windpowerlib.wind_farm.WindFarm` and :class:`~windpowerlib.wind_turbine_cluster.WindTurbineCluster` were removed. Installed power is instead now directly calculated inside the nominal_power getter.
18+
* Removed unnecessary `wake_losses_model` parameter in :py:func:`~.power_curves.wake_losses_to_power_curve`. Whether a constant wind farm efficiency or a wind farm efficiency curve is used is decided by the type of the wind farm efficiency.
19+
* Combined options 'constant_efficiency' and 'power_efficiency_curve' of `wake_losses_model` parameter in :py:func:`~.turbine_cluster_modelchain.TurbineClusterModelChain` to 'wind_farm_efficiency'. Therefore, default value of `wake_losses_model` in :py:func:`~.wind_farm.WindFarm.assign_power_curve` and :py:func:`~.wind_turbine_cluster.WindTurbineCluster.assign_power_curve` changed to 'wind_farm_efficiency'.
20+
* Removed `overwrite` parameter from :py:func:`~.wind_turbine.get_turbine_data_from_oedb`
21+
22+
Other changes
23+
#############
24+
* Power curves and nominal power of wind turbines are now saved in file in W instead of kW to be consistent with internal units.
25+
* Restructured csv reading for offline usage of windpowerlib. The nominal power of wind turbines is now saved to a separate file along with other turbine data from the oedb turbine library.
26+
* get_turbine_types() can now be used to get provided turbine types of oedb turbine library as well as provided turbine types of local files.
27+
28+
Documentation
29+
#############
30+
* Improved documentation of :class:`~windpowerlib.modelchain.ModelChain` and :class:`~windpowerlib.turbine_cluster_modelchain.TurbineClusterModelChain` parameters (`PR 64 <https://github.com/wind-python/windpowerlib/pull/64>`_).
31+
* Added info in README and getting started section on how to contribute to the oedb wind turbine library.
32+
33+
Contributors
34+
############
35+
* Sabine Haas
36+
* Birgit Schachler
37+
* Uwe Krien
38+

0 commit comments

Comments
 (0)