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` diff --git a/photovoltaic_gruppe4.py b/photovoltaic_gruppe4.py index 1285faf..9183523 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("[ ==================== ] 100.00%")