From 615428944ad1057a3b814905c01bc44f61cb2e0c Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 13 Sep 2018 13:29:48 +0200 Subject: [PATCH 1/3] Add fancy schmancy progress bar --- photovoltaic_gruppe4.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/photovoltaic_gruppe4.py b/photovoltaic_gruppe4.py index 1285faf..bbcb24d 100644 --- a/photovoltaic_gruppe4.py +++ b/photovoltaic_gruppe4.py @@ -21,9 +21,26 @@ feature_col = [tf.feature_column.numeric_column(str(idx)) for idx in range(336)] n = pywatts.neural.Net(feature_cols=feature_col) predictions = [] -for query in queries: +total = len(queries) +for idx, query in enumerate(queries): + + percent = idx / total + sys.stdout.write("\r") + progress = "" + for i in range(20): + if i < int(20 * percent): + progress += "=" + else: + progress += " " + sys.stdout.write("[ %s ] %.2f%%" % (progress, percent * 100)) + sys.stdout.flush() + if oneH: predictions.extend(predict(n, query).astype('Float64').tolist()) else: predictions.append(predict24h(n, query)) + print(predictions, file=open("test_data_gruppe4.json", "w")) + +sys.stdout.write("\r") +print("Done!") From 688b4025df511d1d2674ad8041886989cf5b7345 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 13 Sep 2018 14:13:41 +0200 Subject: [PATCH 2/3] Fix script again --- photovoltaic_gruppe4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photovoltaic_gruppe4.py b/photovoltaic_gruppe4.py index bbcb24d..9183523 100644 --- a/photovoltaic_gruppe4.py +++ b/photovoltaic_gruppe4.py @@ -43,4 +43,4 @@ for idx, query in enumerate(queries): print(predictions, file=open("test_data_gruppe4.json", "w")) sys.stdout.write("\r") -print("Done!") +print("[ ==================== ] 100.00%") From a8fd0844d22ecc0eac67cba89ee426c54703dc3e Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 13 Sep 2018 14:50:50 +0200 Subject: [PATCH 3/3] Add readme --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9af26d2 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +PyWatts - Predict Output of Solar Panels + +# Dependencies + +PyWatts is based on python3.6 and uses the following dependencies: + +* requests (2.19.1) +* pypvwatts (2.1.0) +* numpy (1.15.0) +* peewee (3.5.4) +* scikit-learn (0.19.2) +* pandas (0.23.4) +* tensorflow (1.9.0) +* matplotlib (2.2.3) +* scipy (1.1.0) + +We suggest using a python virtualenv. + +# Execute + +The script can be executed by issuing the follwing command: + +```bash +$ python photovoltaic_gruppe4.py data.json +``` + +The output can be found in the same directory in `test_data_gruppe4.json`