Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
33a1730
Download weather file if not present
uvchik Feb 13, 2020
ca2f427
Add comments to make example cleaner
uvchik Feb 13, 2020
777cf97
Move data from data dir to parent dir
uvchik Feb 13, 2020
d643f48
Fix pylint issues
uvchik Feb 13, 2020
c058db5
Revert import changes
uvchik Feb 13, 2020
e19d52b
Add badge
uvchik Feb 13, 2020
d5614d5
Fixe example
uvchik Feb 13, 2020
239ed62
Add create power curve function
uvchik Feb 24, 2020
085f90b
Use another variant of my_turbine instead of dummy_turbine
uvchik Feb 24, 2020
a8b43f4
Fixing style errors.
stickler-ci Feb 24, 2020
08c3b61
Fix lint errors
uvchik Feb 24, 2020
d6216cf
Change config file to ignore unused imports in __init__.py
uvchik Feb 24, 2020
4dcb721
Merge imports
uvchik Feb 24, 2020
221506a
Test another option
uvchik Feb 24, 2020
e9e421f
Fixing style errors.
stickler-ci Feb 24, 2020
12bf952
Add another variant
uvchik Feb 24, 2020
cb55e80
Merge branch 'features/revise-python-script-examples' of github.com:w…
uvchik Feb 24, 2020
8c3fb3a
Change order
uvchik Feb 24, 2020
86f2439
Fixing style errors.
stickler-ci Feb 24, 2020
c671a97
Check another variant
uvchik Feb 24, 2020
596ccfe
Merge branch 'features/revise-python-script-examples' of github.com:w…
uvchik Feb 24, 2020
31ef550
Fixing style errors.
stickler-ci Feb 24, 2020
db1fbc2
Add final soultion
uvchik Feb 24, 2020
025dc89
Merge branch 'features/revise-python-script-examples' of github.com:w…
uvchik Feb 24, 2020
d712171
Fix names in example
uvchik Feb 26, 2020
7cc5a8e
Add basic usage "how to define a turbine" to getting started
uvchik Feb 26, 2020
8147e5c
Add basic turbine definition to README
uvchik Feb 26, 2020
ea3764c
Ignore "imported but not used" error in __init__.py
uvchik Mar 10, 2020
103880f
Blackify the code
uvchik Mar 10, 2020
41c8eea
Shorten line to make it clearer
uvchik Mar 10, 2020
e864dbb
Specify ignored error
uvchik Mar 10, 2020
1e902f3
Merge branch 'dev' of github.com:wind-python/windpowerlib into featur…
uvchik Mar 10, 2020
26e739f
Fixing style errors.
stickler-ci Mar 10, 2020
f130bb0
Blackify code
uvchik Mar 10, 2020
9c04069
Do not ignore F401 in general
uvchik Mar 10, 2020
fcbd378
Merge branch 'features/revise-python-script-examples' of github.com:w…
uvchik Mar 10, 2020
9c5901a
Fix typo in comment
uvchik Mar 10, 2020
3628279
Use one line per import
uvchik Mar 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
:target: https://mybinder.org/v2/gh/wind-python/windpowerlib/dev?filepath=example
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/lgtm/grade/python/g/wind-python/windpowerlib.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/wind-python/windpowerlib/context:python

Introduction
=============
Expand Down Expand Up @@ -82,8 +85,14 @@ You can also look at the examples in the `Examples section <http://windpowerlib.
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 <https://github.com/wind-python/windpowerlib/tree/master/windpowerlib/oedb>`_
(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
(power curves, hub heights, etc.) for a large set of wind turbines. See `Initialize wind turbine` in :ref:`examples_section_label` on how
to use this data in your simulations.

The dataset is hosted and maintained on the `OpenEnergy database <https://openenergy-platform.org/dataedit/>`_ (oedb).
Expand All @@ -94,9 +103,61 @@ To update your local files with the latest version of the `oedb turbine library
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
load_turbine_data_from_oedb()

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

.. code:: python

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 `here <https://github.com/OpenEnergyPlatform/data-preprocessing/issues/28>`_ 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:

.. code::

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.

.. code:: python

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_turbine2)

See the `modelchain_example` for more information.

Contributing
==============

Expand Down
62 changes: 62 additions & 0 deletions doc/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Getting started
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/lgtm/grade/python/g/wind-python/windpowerlib.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/wind-python/windpowerlib/context:python

Introduction
=============

Expand Down Expand Up @@ -84,6 +87,12 @@ You can also look at the examples in the :ref:`examples_section_label` 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 <https://github.com/wind-python/windpowerlib/tree/master/windpowerlib/oedb>`_
(power curves, hub heights, etc.) for a large set of wind turbines. See `Initialize wind turbine` in :ref:`examples_section_label` on how
to use this data in your simulations.
Expand All @@ -96,9 +105,62 @@ To update your local files with the latest version of the `oedb turbine library
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
load_turbine_data_from_oedb()

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

.. code:: python

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 `here <https://github.com/OpenEnergyPlatform/data-preprocessing/issues/28>`_ 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:

.. code::

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.

.. code:: python

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_turbine2)

See the `modelchain_example` for more information.


Contributing
==============

Expand Down
2 changes: 1 addition & 1 deletion example/modelchain_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
"source": [
"# specification of wind turbine where power coefficient curve and nominal\n",
"# power is provided in an own csv file\n",
"csv_path = 'data'\n",
"csv_path = ''\n",
"dummy_turbine = {\n",
" 'turbine_type': 'DUMMY 1', # turbine type as in file\n",
" 'hub_height': 100, # in m\n",
Expand Down
Loading