Skip to content

Commit 777cf97

Browse files
committed
Move data from data dir to parent dir
1 parent ca2f427 commit 777cf97

File tree

10 files changed

+16
-6
lines changed

10 files changed

+16
-6
lines changed

example/modelchain_example.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
"source": [
289289
"# specification of wind turbine where power coefficient curve and nominal\n",
290290
"# power is provided in an own csv file\n",
291-
"csv_path = 'data'\n",
291+
"csv_path = ''\n",
292292
"dummy_turbine = {\n",
293293
" 'turbine_type': 'DUMMY 1', # turbine type as in file\n",
294294
" 'hub_height': 100, # in m\n",

example/modelchain_example.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,11 @@ def initialize_wind_turbines():
144144

145145
# ************************************************************************
146146
# **** Specification of wind turbine with data in own file ***************
147-
csv_path = os.path.join(os.path.dirname(__file__), "data")
148147
dummy_turbine = {
149148
"turbine_type": "DUMMY 1",
150149
"hub_height": 100, # in m
151150
"rotor_diameter": 70, # in m
152-
"path": csv_path,
151+
"path": os.path.dirname(__file__),
153152
}
154153
dummy_turbine = WindTurbine(**dummy_turbine)
155154

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

tests/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,

tests/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

tests/test_wind_turbine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TestWindTurbine:
2222
@classmethod
2323
def setup_class(cls):
2424
"""Setup default values"""
25-
cls.source = os.path.join(os.path.dirname(__file__), "../example/data")
25+
cls.source = os.path.join(os.path.dirname(__file__), "data")
2626

2727
def test_warning(self, recwarn):
2828
test_turbine_data = {

windpowerlib/wind_turbine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class WindTurbine(object):
101101
>>> print(e126.nominal_power)
102102
4200000.0
103103
>>> # Example with own path
104-
>>> path=os.path.join(os.path.dirname(__file__), '../example/data')
104+
>>> path=os.path.join(os.path.dirname(__file__), '../tests/data')
105105
>>> example_turbine={
106106
... 'hub_height': 100,
107107
... 'rotor_diameter': 70,
@@ -378,7 +378,7 @@ def get_turbine_data_from_file(turbine_type, path):
378378
--------
379379
>>> from windpowerlib import wind_turbine
380380
>>> import os
381-
>>> path=os.path.join(os.path.dirname(__file__), '../example/data',
381+
>>> path=os.path.join(os.path.dirname(__file__), '../tests/data',
382382
... 'power_curves.csv')
383383
>>> d3=get_turbine_data_from_file('DUMMY 3', path)
384384
>>> print(d3['value'][7])

0 commit comments

Comments
 (0)