The windpowerlib is a library that provides a set of functions and classes to calculate the power output of wind turbines. It was originally part of the feedinlib (windpower and photovoltaic) but was taken out to build up a community concentrating on wind power models.
For a quick start see the Examples and basic usage section.
Full documentation can be found at readthedocs.
If you have a working Python 3 (>= 3.6) environment, use pypi to install the latest windpowerlib version:
pip install windpowerlib
The windpowerlib is designed for Python 3 and tested on Python >= 3.5. We highly recommend to use virtual environments. Please see the installation page of the oemof documentation for complete instructions on how to install python and a virtual environment on your operating system.
pip install matplotlib
Examples and basic usage
The simplest way to run the example notebooks without installing windpowerlib is to click here and open them with Binder.
The basic usage of the windpowerlib is shown in the ModelChain example that is available as jupyter notebook and python script:
To run the example you need the example weather and turbine data used:
- Example weather data file
- Example power curve data file
- Example power coefficient curve data file
- Example nominal power data file
To run the examples locally you have to install windpowerlib. To run the notebook you also need to install notebook using pip3. To launch jupyter notebook type
jupyter notebook in the terminal.
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 and
how to run jupyter notebooks. In order to reproduce the figures in a notebook you need to install matplotlib.
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 datadata used in this example is the same as in the example above.
- TurbineClusterModelChain example (Python script)
- TurbineClusterModelChain example (Jupyter notebook)
You can also look at the examples in the Examples section.
Wind turbine data
The dataset is hosted and maintained on the OpenEnergy database (oedb). To update your local files with the latest version of the oedb turbine library you can execute the following in your python console:
from windpowerlib.wind_turbine import load_turbine_data_from_oedb load_turbine_data_from_oedb()
We would like to encourage anyone to contribute to the turbine library by adding turbine data or reporting errors in the data. See here for more information on how to contribute.
We are warmly welcoming all who want to contribute to the windpowerlib. If you are interested in wind models and want to help improving the existing model do not hesitate to contact us via github or email (firstname.lastname@example.org).
Clone: https://github.com/wind-python/windpowerlib and install the cloned repository using pip:
pip install -e /path/to/the/repository
How to create a pull request:
- Fork the windpowerlib repository to your own github account.
- Change, add or remove code.
- Commit your changes.
- Create a pull request and describe what you will do and why.
- Wait for approval.
Generally the following steps are required when changing, adding or removing code:
- Add new tests if you have written new functions/classes.
- Add/change the documentation (new feature, API changes ...).
- Add a whatsnew entry and your name to Contributors.
- Check if all tests still work by simply executing pytest in your windpowerlib directory:
Citing the windpowerlib
We use the zenodo project to get a DOI for each version. Search zenodo for the right citation of your windpowerlib version.
Copyright (c) 2019 oemof developer group
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.