Skip to content

Commit 6177ea5

Browse files
committed
Merge branch 'dev' into features/tests
Conflicts: example/basic_example.py windpowerlib/tests/modelchain_tests.py windpowerlib/wind_speed.py windpowerlib/wind_turbine.py
2 parents 36303a9 + 2e3d24a commit 6177ea5

File tree

15 files changed

+9084
-8952
lines changed

15 files changed

+9084
-8952
lines changed

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import sys
1616
import os
17+
import sphinx
18+
from sphinx.errors import VersionRequirementError
1719

1820
# If extensions (or modules to document with autodoc) are in another directory,
1921
# add these directories to sys.path here. If the directory is relative to the
@@ -23,7 +25,10 @@
2325
# -- General configuration ------------------------------------------------
2426

2527
# If your documentation needs a minimal Sphinx version, state it here.
26-
#needs_sphinx = '1.0'
28+
needs_sphinx = '1.4.3'
29+
if needs_sphinx > sphinx.__display_version__:
30+
message = 'This project needs at least Sphinx v%s' % needs_sphinx
31+
raise VersionRequirementError(message)
2732

2833
# Add any Sphinx extension module names here, as strings. They can be
2934
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Welcome to the windpowerlib documentation!
44
Contents:
55

66
.. toctree::
7-
:maxdepth: 5
7+
:maxdepth: 2
88
:glob:
99

1010
getting_started

doc/modules.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.. currentmodule:: windpowerlib
22

3+
#############
4+
API
5+
#############
36

47
Classes
58
=========
@@ -8,7 +11,7 @@ Classes
811
:toctree: temp/
912

1013
wind_turbine.WindTurbine
11-
modelchain.Modelchain
14+
modelchain.ModelChain
1215

1316

1417
Density
@@ -66,28 +69,28 @@ Functions for calculating power output of a wind turbine.
6669
power_output.p_curve_density_corr
6770

6871

69-
Modelchain
72+
ModelChain
7073
==============
7174

72-
Creating a Modelchain object.
75+
Creating a ModelChain object.
7376

7477
.. autosummary::
7578
:toctree: temp/
7679

77-
modelchain.Modelchain
80+
modelchain.ModelChain
7881

79-
Running the modelchain.
82+
Running the ModelChain.
8083

8184
.. autosummary::
8285
:toctree: temp/
8386

84-
modelchain.Modelchain.run_model
87+
modelchain.ModelChain.run_model
8588

86-
Methods of the Modelchain object.
89+
Methods of the ModelChain object.
8790

8891
.. autosummary::
8992
:toctree: temp/
9093

91-
modelchain.Modelchain.rho_hub
92-
modelchain.Modelchain.v_wind_hub
93-
modelchain.Modelchain.turbine_power_output
94+
modelchain.ModelChain.rho_hub
95+
modelchain.ModelChain.v_wind_hub
96+
modelchain.ModelChain.turbine_power_output

doc/whats_new.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ These are new features and improvements of note in each release
88
:local:
99
:backlinks: top
1010

11-
.. include:: whatsnew/v004.txt
12-
.. include:: whatsnew/v003.txt
13-
.. include:: whatsnew/v001.txt
11+
.. include:: whatsnew/v005.txt
12+
.. include:: whatsnew/v004.txt

example/basic_example.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
# Feel free to remove or change these lines
2222
# import warnings
2323
# warnings.simplefilter(action="ignore", category=RuntimeWarning)
24-
logging.getLogger().setLevel(logging.INFO)
24+
logging.getLogger().setLevel(logging.DEBUG)
2525

2626

27-
def read_weather_data(filename, datetime_column='Unnamed: 0',
27+
def read_weather_data(filename, datetime_column='time_index',
2828
**kwargs):
2929
r"""
3030
Fetches weather data from a file.
@@ -61,12 +61,9 @@ def read_weather_data(filename, datetime_column='Unnamed: 0',
6161

6262
# Read weather data from csv
6363
weather = read_weather_data('weather.csv')
64-
weather.index.name = ''
6564

6665
# Specification of the weather data set CoastDat2 (example data)
67-
coastDat2 = {
68-
'dhi': 0,
69-
'dirhi': 0,
66+
data_height = {
7067
'pressure': 0,
7168
'temp_air': 2,
7269
'v_wind': 10,
@@ -78,14 +75,14 @@ def read_weather_data(filename, datetime_column='Unnamed: 0',
7875
enerconE126 = {
7976
'hub_height': 135,
8077
'd_rotor': 127,
81-
'fetch_curve': 'P', # 'P' vor p-curve and 'cp' for cp-curve
78+
'fetch_curve': 'p', # 'p' for p-curve and 'cp' for cp-curve
8279
'turbine_name': 'ENERCON E 126 7500'} # Turbine name as in register. Use
8380
# wind_turbine.get_turbine_types()
8481
# for a full list.
8582
vestasV90 = {
8683
'hub_height': 105,
8784
'd_rotor': 90,
88-
'fetch_curve': 'P',
85+
'fetch_curve': 'p',
8986
'turbine_name': 'VESTAS V 90 3000'}
9087

9188
# Initialize WindTurbine objects
@@ -103,10 +100,10 @@ def read_weather_data(filename, datetime_column='Unnamed: 0',
103100

104101
# Calculate turbine power output
105102
mc_e126 = modelchain.ModelChain(e126, **modelchain_data).run_model(
106-
weather, coastDat2)
103+
weather, data_height)
107104
e126.power_output = mc_e126.power_output
108105
mc_v90 = modelchain.ModelChain(v90, **modelchain_data).run_model(
109-
weather, coastDat2)
106+
weather, data_height)
110107
v90.power_output = mc_v90.power_output
111108

112109
# Plot turbine power output

example/weather.csv

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

tests/test_power_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setup_class(self):
1515
self.d_rotor = 80
1616
self.cp_values = pd.DataFrame(data={'cp': [0.3, 0.4, 0.5]},
1717
index=[4.0, 5.0, 6.0])
18-
self.p_values = pd.DataFrame(data={'P': [300, 400, 500]},
18+
self.p_values = pd.DataFrame(data={'p': [300, 400, 500]},
1919
index=[4.0, 5.0, 6.0])
2020

2121
def test_cp_curve(self):

0 commit comments

Comments
 (0)