Package: windpowerlib
IntroductionThe 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 thefeedinlib(windpower and photovoltaic) but was taken out to build up a community concentrating on wind power models.For a quick start see theExamples and basic usagesection.DocumentationFull documentation can be found atreadthedocs.Use theproject siteof readthedocs to choose the version of the documentation.
Go to thedownload pageto download different versions and formats (pdf, html, epub) of the documentation.InstallationIf you have a working Python 3 environment, use pypi to install the latest windpowerlib version:pip install windpowerlibThe windpowerlib is designed for Python 3 and tested on Python >= 3.10. We highly recommend to use virtual environments.
Please see theinstallation pageof the oemof documentation for complete instructions on how to install python and a virtual environment on your operating system.Optional PackagesTo see the plots of the windpowerlib example in theExamples and basic usagesection you shouldinstall the matplotlib package.
Matplotlib can be installed using pip:pip install matplotlibExamples and basic usageThe simplest way to run the example notebooks without installing windpowerlib is to clickhereand open them with Binder.The basic usage of the windpowerlib is shown in theModelChain examplethat is available as jupyter notebook and python script:ModelChain example (Python script)ModelChain example (Jupyter notebook)To run the example you need example weather that is downloaded automatically and can also be downloaded here:Example weather data fileTo run the examples locally you have to install the windpowerlib. To run the notebook you also need to installnotebookusing pip3. To launch jupyter notebook typejupyter notebookin 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 onhow to installandhow to runjupyter notebooks. In order to reproduce the figures in a notebook you need to installmatplotlib.Further functionalities, like the modelling of wind farms and wind turbine clusters, are shown in theTurbineClusterModelChain 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.TurbineClusterModelChain example (Python script)TurbineClusterModelChain example (Jupyter notebook)You can also look at the examples in theExamples section.Wind turbine dataThe windpowerlib provides data of many wind turbines but it is also possible to
use your own turbine data.Use internal dataThe windpowerlib provideswind turbine data(power curves, hub heights, etc.) for a large set of wind turbines. SeeInitialize wind turbineinExamples sectionon how
to use this data in your simulations.The dataset is hosted and maintained on theOpenEnergy database(oedb).
To update your local files with the latest version of theoedb turbine libraryyou can execute the following in your python console:fromwindpowerlib.dataimportstore_turbine_data_from_oedbstore_turbine_data_from_oedb()If you find your turbine in the database it is very easy to use it in the
windpowerlibfromwindpowerlibimportWindTurbineenercon_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.
Seethe OEPfor more information on how to contribute.Use your own turbine dataIt 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.0You 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.importpandasaspdfromwindpowerlibimportWindTurbine,create_power_curvemy_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 themodelchain_examplefor more information.ContributingWe 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/windpowerliband install the cloned repository using pip:pipinstall-e/path/to/the/repositoryAs the windpowerlib started with contributors from theoemof developer groupwe use the samedeveloper rules.How to create a pull request:Forkthe windpowerlib repository to your own github account.Change, add or remove code.Commit your changes.Create apull requestand 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:pytestCiting the windpowerlibWe use the zenodo project to get a DOI for each version.Search zenodo for the right citation of your windpowerlib version.LicenseCopyright (c) 2019 oemof developer groupPermission 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.