Skip to content

Commit

Permalink
Merge 597a60e into 0f29036
Browse files Browse the repository at this point in the history
  • Loading branch information
SabineHaas committed Jan 31, 2019
2 parents 0f29036 + 597a60e commit 2f5b16f
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 42 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
:target: https://travis-ci.org/wind-python/windpowerlib
.. image:: https://coveralls.io/repos/github/wind-python/windpowerlib/badge.svg?branch=dev
:target: https://coveralls.io/github/wind-python/windpowerlib?branch=dev
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2542896.svg
:target: https://doi.org/10.5281/zenodo.2542896
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.824267.svg
:target: https://doi.org/10.5281/zenodo.824267

Introduction
=============
Expand Down
31 changes: 6 additions & 25 deletions doc/whatsnew/v0-1-1.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
v0.1.1 (latest in August 2019)
v0.1.1 (January 31, 2019)
++++++++++++++++++++++++++++++


New functions
#############



Testing
#######



Documentation
#############



API changes
###########



Other changes
#############

* Adapted csv reading to pandas API change
* Removed logging message for successful database connection
* Added system exit and error message in case a non-existing power (coefficient) curve of an existing turbine type is tried to be used


Contributors
############


* Uwe Krien
* Sabine Haas
33 changes: 33 additions & 0 deletions doc/whatsnew/v0-1-2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
v0.1.2 (latest in August 2019)
++++++++++++++++++++++++++++++


New functions
#############



Testing
#######



Documentation
#############



API changes
###########



Other changes
#############



Contributors
############


12 changes: 7 additions & 5 deletions example/modelchain_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,17 @@
" os.path.dirname(__file__))[0], 'example')\n",
" file = os.path.join(kwargs['datapath'], filename)\n",
" # read csv file \n",
" weather_df = pd.read_csv(file, index_col=0, header=[0, 1])\n",
" weather_df = pd.read_csv(\n",
" file, index_col=0, header=[0, 1],\n",
" date_parser=lambda idx: pd.to_datetime(idx, utc=True))\n",
" # change type of index to datetime and set time zone\n",
" weather_df.index = pd.to_datetime(weather_df.index).tz_localize(\n",
" 'UTC').tz_convert('Europe/Berlin')\n",
" weather_df.index = pd.to_datetime(weather_df.index).tz_convert(\n",
" 'Europe/Berlin')\n",
" # change type of height from str to int by resetting columns\n",
" weather_df.columns = [weather_df.axes[1].levels[0][\n",
" weather_df.axes[1].labels[0]],\n",
" weather_df.axes[1].codes[0]],\n",
" weather_df.axes[1].levels[1][\n",
" weather_df.axes[1].labels[1]].astype(int)]\n",
" weather_df.axes[1].codes[1]].astype(int)]\n",
" return weather_df\n",
"\n",
"\n",
Expand Down
12 changes: 7 additions & 5 deletions example/modelchain_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ def get_weather_data(filename='weather.csv', **kwargs):
os.path.dirname(__file__))[0], 'example')
file = os.path.join(kwargs['datapath'], filename)
# read csv file
weather_df = pd.read_csv(file, index_col=0, header=[0, 1])
weather_df = pd.read_csv(
file, index_col=0, header=[0, 1],
date_parser=lambda idx: pd.to_datetime(idx, utc=True))
# change type of index to datetime and set time zone
weather_df.index = pd.to_datetime(weather_df.index).tz_localize(
'UTC').tz_convert('Europe/Berlin')
weather_df.index = pd.to_datetime(weather_df.index).tz_convert(
'Europe/Berlin')
# change type of height from str to int by resetting columns
weather_df.columns = [weather_df.axes[1].levels[0][
weather_df.axes[1].labels[0]],
weather_df.axes[1].codes[0]],
weather_df.axes[1].levels[1][
weather_df.axes[1].labels[1]].astype(int)]
weather_df.axes[1].codes[1]].astype(int)]
return weather_df


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ def read(fname):
'windpowerlib': [os.path.join('data', '*.csv')]},
long_description=read('README.rst'),
zip_safe=False,
install_requires=['pandas >= 0.19.1',
'requests'])
install_requires=['pandas >= 0.19.1, < 0.25 ',
'requests < 3.0'])
4 changes: 1 addition & 3 deletions windpowerlib/wind_turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ def load_turbine_data_from_oedb():
result = requests.get(
oep_url + '/api/v0/schema/{}/tables/{}/rows/?'.format(
schema, table), )
if result.status_code == 200:
logging.info("Database connection successful.")
else:
if not result.status_code == 200:
raise ConnectionError("Database connection not successful. " +
"Error: ".format(result.status_code))
# extract data
Expand Down

0 comments on commit 2f5b16f

Please sign in to comment.