Skip to content

Commit 03d489d

Browse files
authored
Merge pull request #62 from wind-python/refactor_v0.2.0_branch
Refactor WindTurbine class
2 parents 0aeee7b + abe1669 commit 03d489d

37 files changed

+1219
-1032
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,3 @@ ENV/
9898

9999
# tests
100100
.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

doc/getting_started.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,38 @@ If you have a working Python 3 environment, use pypi to install the latest windp
3232
The windpowerlib is designed for Python 3 and tested on Python >= 3.5.
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 pip3:
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/example_power_curves.csv>`
59+
* :download:`Example power coefficient curve data file <../example/data/example_power_coefficient_curves.csv>`
60+
* :download:`Example nominal power data file <../example/data/example_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>`
@@ -107,7 +114,7 @@ We use the zenodo project to get a DOI for each version. `Search zenodo for the
107114
License
108115
============
109116

110-
Copyright (C) 2017 oemof developing group
117+
Copyright (C) 2017 oemof developer group
111118

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

doc/modules.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ power curve or power coefficient curve needed by the :py:class:`~.wind_turbine.W
6767
.. autosummary::
6868
:toctree: temp/
6969

70-
wind_turbine.WindTurbine.fetch_turbine_data
7170
wind_turbine.get_turbine_data_from_file
72-
wind_turbine.get_turbine_data_from_oedb
71+
wind_turbine.get_oedb_turbine_data
7372
wind_turbine.load_turbine_data_from_oedb
7473
wind_turbine.get_turbine_types
7574

doc/whatsnew/v0-2-0.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,37 @@ v0.2.0 ()
33

44
New features
55
############
6+
* 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
7+
8+
Documentation
9+
#############
10+
11+
12+
Testing
13+
#######
14+
615

716
Bug fixes
817
#########
918

19+
1020
API changes
11-
###########
21+
#############
22+
* 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.
23+
* 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'.
24+
* Removed `overwrite` parameter from :py:func:`~.wind_turbine.get_turbine_data_from_oedb`
25+
* Removed `data_source` and `fetch_curve` parameters from :py:func:`~.wind_turbine.WindTurbine` and :py:func:`~.wind_turbine.WindTurbine.fetch_turbine_data`. Now the source and if a curve is fetched or not is specified by the parameters `power_curve`, `power_coefficient_curve` and `nominal_power`. See :py:func:`~.wind_turbine.WindTurbine.fetch_turbine_data` for a description.
1226

1327
Other changes
1428
#############
29+
* Power curves and nominal power of wind turbines are now saved in file in W instead of kW.
30+
* 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.
1531

16-
Testing
17-
#######
1832

1933
Deprecations
2034
############
2135

22-
2336
Contributors
2437
############
38+
* Sabine Haas
39+

example/data/example_power_coefficient_curves.csv

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

example/data/example_power_curves.csv

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
turbine_type,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26
2+
DUMMY 1,0,,0,,0,,0,0,0.13,,0.38,,0.46,,0.48,,0.47,,0.44,,0.4,,0.36,,0.31,,0.26,,0.23,,0.2,,0.18,,0.14,,0.11,,0.1,,0.09,,0.07,,0.05,,0.04,,0.04,,0.03,,0
3+
DUMMY 2,0,,0,,0,,0.16,0.29,0.35,0.38,0.4,0.41,0.42,0.43,0.43,0.44,0.44,0.44,0.44,0.43,0.42,0.39,0.36,0.32,0.29,0.26,0.23,0.2,0.18,0.16,0.15,0.14,0.12,0.11,0.1,0.09,0.09,0.08,0.07,0.07,0.06,0.06,0.05,0.05,0.05,0.04,0.04,0.04,0.04,0.03,0.03,0,0

example/data/power_curves.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
turbine_type,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26
2+
DUMMY 3,0,0,0,0,0,0,0,18000,34000,70000,10000,150000,190000,260000,330000,420000,510000,620000,740000,880000,1020000,1180000,1330000,1420000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,1500000,0,
3+
DUMMY 4,0,,0,,0,,0,,4000,,22000,,46000,,76000,,111000,,147000,,184000,,219000,,249000,,274000,,290000,,297000,,302000,,307000,,307000,,305000,,295000,,280000,,260000,,240000,,230000,,225000,0,

example/data/turbine_data.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
turbine_type,nominal_power
2+
DUMMY 1,4200000
3+
DUMMY 2,4200000
4+
DUMMY 3,1500000
5+
DUMMY 4,225000

example/modelchain_example.ipynb

Lines changed: 76 additions & 45 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)