Skip to main content
https://travis-ci.org/wind-python/windpowerlib.svg?branch=dev https://coveralls.io/repos/github/wind-python/windpowerlib/badge.svg?branch=dev https://zenodo.org/badge/DOI/10.5281/zenodo.824267.svg https://mybinder.org/badge_logo.svg https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/lgtm/grade/python/g/wind-python/windpowerlib.svg?logo=lgtm&logoWidth=18

Introduction

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.

Documentation

Full documentation can be found at readthedocs.

Use the project site of readthedocs to choose the version of the documentation. Go to the download page to download different versions and formats (pdf, html, epub) of the documentation.

Installation

If you have a working Python 3 environment, use pypi to install the latest windpowerlib version:

pip install windpowerlib

The windpowerlib is designed for Python 3 and tested on Python >= 3.10. 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.

Optional Packages

To see the plots of the windpowerlib example in the Examples and basic usage section you should install the matplotlib package. Matplotlib can be installed using pip:

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 example weather that is downloaded automatically and can also be downloaded here:

To run the examples locally 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. 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 used in this example is the same as in the ModelChain example.

You can also look at the examples in the Examples section.

Wind turbine data

The windpowerlib provides data of many wind turbines but it is also possible to use your own turbine data.

Use internal data

The windpowerlib provides wind turbine data (power curves, hub heights, etc.) for a large set of wind turbines. See Initialize wind turbine in Examples section on how to use this data in your simulations.

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.data import store_turbine_data_from_oedb
store_turbine_data_from_oedb()

If you find your turbine in the database it is very easy to use it in the windpowerlib

from windpowerlib import WindTurbine
enercon_e126 = {
    "turbine_type": "E-126/4200",  # turbine type as in register
    "hub_height": 135,  # in m
}
e126 = WindTurbine(**enercon_e126)

We would like to encourage anyone to contribute to the turbine library by adding turbine data or reporting errors in the data. See the OEP for more information on how to contribute.

Use your own turbine data

It is possible to use your own power curve. However, the most sustainable way is to send us the data to be included in the windpowerlib and to be available for all users. This may not be possible in all cases.

Assuming the data files looks like this:

wind,power
0.0,0.0
3.0,39000.0
5.0,270000.0
10.0,2250000.0
15.0,4500000.0
25.0,4500000.0

You can use pandas to read the file and pass it to the turbine dictionary. I you have basic knowledge of pandas it is easy to use any kind of data file.

import pandas as pd
from windpowerlib import WindTurbine, create_power_curve
my_data = pd.read_csv("path/to/my/data/file.csv")

my_turbine_data = {
    "nominal_power": 6e6,  # in W
    "hub_height": 115,  # in m
    "power_curve": create_power_curve(
        wind_speed=my_data["wind"], power=my_data["power"]
    ),
}

my_turbine = WindTurbine(**my_turbine_data)

See the modelchain_example for more information.

Contributing

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 (windpowerlib@rl-institut.de).

Clone: https://github.com/wind-python/windpowerlib and install the cloned repository using pip:

pip install -e /path/to/the/repository

As the windpowerlib started with contributors from the oemof developer group we use the same developer rules.

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:

pytest

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.

License

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.

Release files for windpowerlib 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for windpowerlib 0.2.2
File Size Uploaded
windpowerlib-0.2.2.tar.gz 82.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for windpowerlib 0.2.2
File Interpreter ABI Platform
windpowerlib-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size:157.0 kB

Release files / windpowerlib-0.2.2.tar.gz

Download URL windpowerlib-0.2.2.tar.gz
Size 82.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f61a31569c90fa97dab42bf81af6526d8d36eda3b56b4f9b1d5bdf126ae14224
BLAKE2b-256 checksum
How to use checksums
a7d4a900a51ab869d94aca9f9d7f056c7ad7419aa639f48fcd0e481f5ef2a44a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release files / windpowerlib-0.2.2-py3-none-any.whl

Download URL windpowerlib-0.2.2-py3-none-any.whl
Size 74.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cc4ee1c0677c0b6a790149389f2f6713d0b7bb7b48db6a0e4ab6184d2369721
BLAKE2b-256 checksum
How to use checksums
eeb8cebae223832e7306e070a9285fd2a785bcd687cc6706f5ff280765f111b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page