Skip to content

Commit 9bc2661

Browse files
committed
merge "remove_vernetzen_server" into "dev"
2 parents 3d545ff + e6463e3 commit 9bc2661

File tree

6 files changed

+8784
-75
lines changed

6 files changed

+8784
-75
lines changed

doc/whatsnew/v004.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ v0.0.4 ()
44
New features
55
############
66

7+
* cp-values database file is now part of the repository and will be installed using pip/setup.py. The former download server was down due to technical problems and it might be safer not to be reliant on an external server.
8+
79

810
Documentation
911
#############
@@ -24,4 +26,4 @@ Other changes
2426
Contributors
2527
############
2628

27-
* name
29+
* Uwe Krien

example/basic_example.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
import pandas as pd
55
import logging
6-
import os
7-
import requests
86

97
try:
108
from matplotlib import pyplot as plt
@@ -40,37 +38,14 @@
4038
'wind_conv_type': 'VESTAS V 90 3000'}
4139

4240

43-
def download_file(filename, url):
44-
if not os.path.isfile(filename):
45-
logging.info('Copying weather data from {0} to {1}'.format(
46-
url, filename))
47-
req = requests.get(url)
48-
with open(filename, 'wb') as fout:
49-
fout.write(req.content)
50-
51-
def fetch_example_files():
52-
basic_path = os.path.join(os.path.expanduser("~"), '.oemof')
53-
filename_1 = os.path.join(basic_path, 'weather.csv')
54-
url1 = 'http://vernetzen.uni-flensburg.de/~git/weather.csv'
55-
filename_2 = os.path.join(basic_path, 'weather_wittenberg.csv')
56-
url2 = 'http://vernetzen.uni-flensburg.de/~git/weather_wittenberg.csv'
57-
if not os.path.exists(basic_path):
58-
os.makedirs(basic_path)
59-
download_file(filename_1, url1)
60-
download_file(filename_2, url2)
61-
return filename_1, filename_2
62-
63-
6441
def ready_example_data(filename, datetime_column='Unnamed: 0'):
6542
df = pd.read_csv(filename)
6643
return df.set_index(pd.to_datetime(df[datetime_column])).tz_localize(
6744
'UTC').tz_convert('Europe/Berlin').drop(datetime_column, 1)
6845

6946

70-
filename1, filename2 = fetch_example_files()
71-
7247
# Loading weather data
73-
weather_df = ready_example_data(filename1)
48+
weather_df = ready_example_data('weather.csv')
7449

7550
e126 = basicmodel.SimpleWindTurbine(**enerconE126)
7651
v90 = basicmodel.SimpleWindTurbine(**vestasV90)

0 commit comments

Comments
 (0)