Skip to content

Commit 588b1d5

Browse files
authored
Merge pull request #40 from wind-python/dev
Merge dev to master for release
2 parents 0f29036 + 597a60e commit 588b1d5

File tree

7 files changed

+58
-42
lines changed

7 files changed

+58
-42
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
:target: https://travis-ci.org/wind-python/windpowerlib
33
.. image:: https://coveralls.io/repos/github/wind-python/windpowerlib/badge.svg?branch=dev
44
:target: https://coveralls.io/github/wind-python/windpowerlib?branch=dev
5-
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2542896.svg
6-
:target: https://doi.org/10.5281/zenodo.2542896
5+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.824267.svg
6+
:target: https://doi.org/10.5281/zenodo.824267
77

88
Introduction
99
=============

doc/whatsnew/v0-1-1.txt

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
1-
v0.1.1 (latest in August 2019)
1+
v0.1.1 (January 31, 2019)
22
++++++++++++++++++++++++++++++
33

4-
5-
New functions
6-
#############
7-
8-
9-
10-
Testing
11-
#######
12-
13-
14-
15-
Documentation
16-
#############
17-
18-
19-
20-
API changes
21-
###########
22-
23-
24-
254
Other changes
265
#############
27-
6+
* Adapted csv reading to pandas API change
7+
* Removed logging message for successful database connection
8+
* Added system exit and error message in case a non-existing power (coefficient) curve of an existing turbine type is tried to be used
289

2910

3011
Contributors
3112
############
32-
33-
13+
* Uwe Krien
14+
* Sabine Haas

doc/whatsnew/v0-1-2.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
v0.1.2 (latest in August 2019)
2+
++++++++++++++++++++++++++++++
3+
4+
5+
New functions
6+
#############
7+
8+
9+
10+
Testing
11+
#######
12+
13+
14+
15+
Documentation
16+
#############
17+
18+
19+
20+
API changes
21+
###########
22+
23+
24+
25+
Other changes
26+
#############
27+
28+
29+
30+
Contributors
31+
############
32+
33+

example/modelchain_example.ipynb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,17 @@
122122
" os.path.dirname(__file__))[0], 'example')\n",
123123
" file = os.path.join(kwargs['datapath'], filename)\n",
124124
" # read csv file \n",
125-
" weather_df = pd.read_csv(file, index_col=0, header=[0, 1])\n",
125+
" weather_df = pd.read_csv(\n",
126+
" file, index_col=0, header=[0, 1],\n",
127+
" date_parser=lambda idx: pd.to_datetime(idx, utc=True))\n",
126128
" # change type of index to datetime and set time zone\n",
127-
" weather_df.index = pd.to_datetime(weather_df.index).tz_localize(\n",
128-
" 'UTC').tz_convert('Europe/Berlin')\n",
129+
" weather_df.index = pd.to_datetime(weather_df.index).tz_convert(\n",
130+
" 'Europe/Berlin')\n",
129131
" # change type of height from str to int by resetting columns\n",
130132
" weather_df.columns = [weather_df.axes[1].levels[0][\n",
131-
" weather_df.axes[1].labels[0]],\n",
133+
" weather_df.axes[1].codes[0]],\n",
132134
" weather_df.axes[1].levels[1][\n",
133-
" weather_df.axes[1].labels[1]].astype(int)]\n",
135+
" weather_df.axes[1].codes[1]].astype(int)]\n",
134136
" return weather_df\n",
135137
"\n",
136138
"\n",

example/modelchain_example.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,17 @@ def get_weather_data(filename='weather.csv', **kwargs):
7272
os.path.dirname(__file__))[0], 'example')
7373
file = os.path.join(kwargs['datapath'], filename)
7474
# read csv file
75-
weather_df = pd.read_csv(file, index_col=0, header=[0, 1])
75+
weather_df = pd.read_csv(
76+
file, index_col=0, header=[0, 1],
77+
date_parser=lambda idx: pd.to_datetime(idx, utc=True))
7678
# change type of index to datetime and set time zone
77-
weather_df.index = pd.to_datetime(weather_df.index).tz_localize(
78-
'UTC').tz_convert('Europe/Berlin')
79+
weather_df.index = pd.to_datetime(weather_df.index).tz_convert(
80+
'Europe/Berlin')
7981
# change type of height from str to int by resetting columns
8082
weather_df.columns = [weather_df.axes[1].levels[0][
81-
weather_df.axes[1].labels[0]],
83+
weather_df.axes[1].codes[0]],
8284
weather_df.axes[1].levels[1][
83-
weather_df.axes[1].labels[1]].astype(int)]
85+
weather_df.axes[1].codes[1]].astype(int)]
8486
return weather_df
8587

8688

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ def read(fname):
1616
'windpowerlib': [os.path.join('data', '*.csv')]},
1717
long_description=read('README.rst'),
1818
zip_safe=False,
19-
install_requires=['pandas >= 0.19.1',
20-
'requests'])
19+
install_requires=['pandas >= 0.19.1, < 0.25 ',
20+
'requests < 3.0'])

windpowerlib/wind_turbine.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,7 @@ def load_turbine_data_from_oedb():
336336
result = requests.get(
337337
oep_url + '/api/v0/schema/{}/tables/{}/rows/?'.format(
338338
schema, table), )
339-
if result.status_code == 200:
340-
logging.info("Database connection successful.")
341-
else:
339+
if not result.status_code == 200:
342340
raise ConnectionError("Database connection not successful. " +
343341
"Error: ".format(result.status_code))
344342
# extract data

0 commit comments

Comments
 (0)