Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of class_akku to Battery #130

Closed
wants to merge 195 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
c2e6396
Add files via upload
drbacke Feb 16, 2024
7515e95
Initialer Commit
drbacke Feb 16, 2024
645528c
sd
drbacke Feb 16, 2024
d547bf4
Server Load Class
drbacke Feb 18, 2024
fde21ab
EMS, Akku + erster Testfall (test.py)
drbacke Feb 18, 2024
f2a2fde
Bilanzen + grafische Ausgabe
drbacke Feb 18, 2024
829aea2
Optimierung Entladezustand Akku
drbacke Feb 18, 2024
bc763cf
Pfadkonstruktion OS-uebergreifend
gvzdus Feb 18, 2024
fd24077
Heatpump
drbacke Feb 18, 2024
9765127
Merge remote-tracking branch 'remotes/origin/main'
drbacke Feb 18, 2024
1b94af6
PV Forecast mit URL möglich + persistenter Cache eingebaut
drbacke Feb 25, 2024
f96fd12
Strompreise aus URL möglich, Source unsere API + pers. Cache
drbacke Feb 25, 2024
3d8a79c
Startpunkt setzbar und Prognosezeitraum ebenfalls.
drbacke Feb 25, 2024
82992f8
Bug strompreise, ein Array Element zu wenig eingelesen (bspw. 23 stat…
drbacke Feb 26, 2024
3fda73b
Last Container zum Vereinheitlichen und Bugfixes
drbacke Mar 3, 2024
0c4e3cd
E-Auto integriert und visualisiert
drbacke Mar 3, 2024
aaa7bcc
Create README.md
drbacke Mar 3, 2024
01b8c96
Update README.md
drbacke Mar 3, 2024
a290ae6
Update README.md
drbacke Mar 3, 2024
ea543a0
- Akku mit Verlusten + Bug in der test.py Gesamtlast kein update
drbacke Mar 3, 2024
d297a18
Merge https://github.com/Akkudoktor-EOS/EOS
drbacke Mar 3, 2024
657fc1c
EAuto mit unterschiedlicher Ladeleistung (auch Optimierung)
drbacke Mar 4, 2024
0ed41fb
Wärmepumpen Klasse für meine WP erzeugt (Achtung Standard)
drbacke Mar 8, 2024
6655540
Update README.md
drbacke Mar 9, 2024
fe25581
Update README.md
drbacke Mar 9, 2024
e371f76
Verluste stündlich / gesamt werden ausgegeben und mit minimiert
drbacke Mar 25, 2024
d881d50
Merge https://github.com/Akkudoktor-EOS/EOS
drbacke Mar 25, 2024
cacc966
Update README.md
drbacke Mar 25, 2024
46daab2
Flask Server
drbacke Mar 28, 2024
1d589b7
PV Akkus to_dict
drbacke Mar 28, 2024
4b9ee2b
Unsinn
drbacke Mar 28, 2024
3949ba7
Flask Server
drbacke Mar 29, 2024
ede2eb5
Added requirements.txt as mentioned in README.md
gvzdus Mar 29, 2024
21ccc92
Eauto gelöscht,
drbacke Mar 29, 2024
154514a
Optimierbare Last, z.B. Spülmaschine
drbacke Mar 29, 2024
31e35f7
Sommerzeit Probleme (bei Zeitumstellung gibt es eine Stunde weniger)
drbacke Mar 31, 2024
f5e7b39
Zeitprobleme (Sommerzeit, Strompreis + 0:00)
drbacke Apr 1, 2024
8a4150c
Flask Server aufgeräumt und optimierung in class_optimize gekapselt
drbacke Apr 1, 2024
7edd8b8
Haushaltsgeräte wie z.B. Spülmaschine
drbacke Apr 2, 2024
e9da546
Violinenplot zur Optimierung / Zielfunktionalen
drbacke Apr 17, 2024
7eb1059
PV API eingefügPV API eingefügtt # Please enter the commit message for
drbacke Apr 17, 2024
12116aa
Update README.md
drbacke Apr 17, 2024
18fde6c
AC Charge TODO
drbacke Apr 28, 2024
3dac33a
SoC Schätzung / Gaussprozess hinzugefügt
drbacke May 1, 2024
58fa833
Neues LFP Modell, die Daten für das Training waren falsch (Auflösung war
drbacke May 1, 2024
d3a2fc3
Akku zurück, Verluste falsch
drbacke May 1, 2024
f7adfb9
Maximale Wechselrichter Leistung
drbacke May 1, 2024
3d26a47
Inverter Klasse hinzugefügt
drbacke May 2, 2024
ecd28cb
Apache 2.0 Lizenz
drbacke May 3, 2024
3244990
NOTICE + requirements angepasst
drbacke May 3, 2024
8d8aa50
Notice
drbacke May 3, 2024
7751823
48 Stunden Predcition & Optimierung
drbacke May 8, 2024
b333e30
Strompreis entkoppelt, kann jetzt als Array übergeben werden.
drbacke Jul 30, 2024
05b838f
Lastprognose entkoppelt, an den Optimierer wird jetzt nur das Array
drbacke Jul 30, 2024
9e3b027
Update README.md
drbacke Jul 30, 2024
699f938
Update README.md
drbacke Jul 30, 2024
2234aa7
Update README.md
drbacke Jul 30, 2024
bfee8fc
PV & Temperatur Prognose als Array an den Flask Server übergeben, so
drbacke Jul 30, 2024
99c7f5a
Update README.md
drbacke Jul 30, 2024
cd01340
Config Bsp.
drbacke Jul 31, 2024
2243066
Neues Lastprognose Modell mit Korrektur
drbacke Aug 1, 2024
c6de4a3
Update README.md
drbacke Aug 2, 2024
273d897
Prediction = 0 führte zu Fehler
drbacke Aug 3, 2024
0758f3d
Lastausgabe der Simulation war ohne Netzbezug, also teils zu niedrig
drbacke Aug 8, 2024
949e2a4
Einzeltestfall auf neusten Stand gebracht
drbacke Aug 21, 2024
6d0c7c2
Bug in der Inverter Klasse, Maximale Batterie Leistung wurde als Grenze
drbacke Aug 21, 2024
c3a7b39
Optimierungsparameter jetzt linear geordnet
drbacke Aug 24, 2024
6fe5dd1
Verluste erstmal entfernt, macht die Auswertung zu komplex
drbacke Aug 24, 2024
0613dbf
Wallbox Leistung wird von der Lastprognose abgezogen
drbacke Aug 30, 2024
4bd1831
Anfangs und Endzustand jeder Stunden berücksichtigt.
drbacke Aug 31, 2024
4749e48
E-Auto/Wallbox wird jetzt mit diskreten Ladezuständen versehen, in der
drbacke Sep 4, 2024
df5377d
Update config.py
drbacke Sep 4, 2024
8447eb8
Config.py lokal
drbacke Sep 4, 2024
6ba1a23
Merge branch 'main' of https://github.com/Akkudoktor-EOS/EOS
drbacke Sep 4, 2024
8627092
Config
drbacke Sep 4, 2024
7e71ca8
config Example hochgeladen.
drbacke Sep 4, 2024
78f3d85
Update README.md
drbacke Sep 4, 2024
331bd4a
Update README.md
drbacke Sep 4, 2024
3e5d2cf
Vergessen
drbacke Sep 5, 2024
b6e2de6
Tote Module entfernt
drbacke Sep 5, 2024
ee304ff
optimzation_hours
drbacke Sep 5, 2024
21a40a6
gesamtlast_simple
drbacke Sep 5, 2024
671506b
Gesamtlast Bug
drbacke Sep 5, 2024
1d20173
Gesamtlast_simple
drbacke Sep 5, 2024
d92bf3f
Update README.md
drbacke Sep 6, 2024
968aab0
Update README.md
drbacke Sep 6, 2024
ccebaa5
Lastprediction als Service verfügbar und ohne DB Abfrage.
drbacke Sep 8, 2024
b8da04c
Create dependabot.yml
danimo Sep 10, 2024
dccb3ee
fixup and freeze requirements.txt
danimo Sep 10, 2024
a339b8d
allow setting custom port
danimo Sep 10, 2024
63ad229
feat: andere ports/bind ips erlauben
danimo Sep 10, 2024
7667e1b
feat: Detailliertere README
danimo Sep 10, 2024
d7e37b0
feat: add documentation, enable makefile driven usage
danimo Sep 10, 2024
4402fe0
feat: be helpful, provide a list of valid routes when visiting /
danimo Sep 10, 2024
d498a99
Optimierungsparameter eingestellt
drbacke Sep 15, 2024
11b6de6
Mitmachen-Sektion mit Anlaufstellen in die README.dm eingefügt
danimo Sep 16, 2024
6990218
Update README.md
drbacke Sep 16, 2024
a954ca9
ci: dockerize setup
dsiebel Sep 16, 2024
fb14976
ci: don't upgrade pip
dsiebel Sep 16, 2024
6681f6d
chore: move credentials to env
dsiebel Sep 16, 2024
c592138
remove unused volume
dsiebel Sep 16, 2024
2966c1f
use directory path prefixes
dsiebel Sep 16, 2024
dbb6e97
new empty data dir for mariadb
dsiebel Sep 16, 2024
36537fe
ignore data dir
dsiebel Sep 16, 2024
9e25154
more dir suffixes
dsiebel Sep 16, 2024
55a2691
add docker-run to help target
dsiebel Sep 16, 2024
68232e5
make docker-run PHONY
dsiebel Sep 16, 2024
b01196d
use new compose plugin for docker
dsiebel Sep 16, 2024
e22c679
fix maridb volume path
dsiebel Sep 16, 2024
9646d8e
expose flask port
dsiebel Sep 17, 2024
79f06fb
Bump idna from 3.8 to 3.10
dependabot[bot] Sep 16, 2024
9ac2d5f
Bump protobuf from 4.25.4 to 5.28.1
dependabot[bot] Sep 16, 2024
8c1d1b3
Bump pytz from 2024.1 to 2024.2
dependabot[bot] Sep 16, 2024
25a7160
Bump urllib3 from 2.2.2 to 2.2.3
dependabot[bot] Sep 16, 2024
62bd7d5
Bump ml-dtypes from 0.4.0 to 0.5.0
dependabot[bot] Sep 16, 2024
f7ab700
fix: make port configurable via env
dsiebel Sep 17, 2024
981ec95
change default port to 3000
dsiebel Sep 17, 2024
ac3d3f5
change default port to 8503
dsiebel Sep 18, 2024
18f7f34
Update test.py
NormannK Sep 19, 2024
fabee51
Update flask_server.py
NormannK Sep 18, 2024
974b3f5
Update class_soc_calc.py
drbacke Sep 23, 2024
e209029
Bump tzdata from 2024.1 to 2024.2
dependabot[bot] Sep 23, 2024
9d8c2d6
Bump fonttools from 4.53.1 to 4.54.0
dependabot[bot] Sep 23, 2024
3e166bf
Bump setuptools from 74.1.2 to 75.1.0
dependabot[bot] Sep 23, 2024
bd75c6f
Bump scikit-learn from 1.5.1 to 1.5.2
dependabot[bot] Sep 23, 2024
6943448
Bump protobuf from 5.28.1 to 5.28.2
dependabot[bot] Sep 23, 2024
21118a3
restructure and optimization of class_optimize.py
NormannK Sep 28, 2024
be66244
Update server_load_profile.py
NormannK Sep 20, 2024
dc30f47
Update test.py
NormannK Sep 20, 2024
4e487e3
Update visualize.py
NormannK Sep 20, 2024
ce5f836
Add english translation for readme.
fortrieb Sep 27, 2024
f5ddc82
Update flask_server.py
NormannK Sep 20, 2024
9f80885
Revert "restructure and optimization of class_optimize.py"
drbacke Sep 30, 2024
7ed6a3c
Bugfix: datetime.datetime -> datetime
drbacke Sep 30, 2024
1458742
Performance
drbacke Sep 30, 2024
11d89e3
Bugfix: Load Simulation did not return Data
drbacke Oct 1, 2024
c096ac3
Merge branch 'main' of https://github.com/Akkudoktor-EOS/EOS
drbacke Oct 1, 2024
fc6887c
Bugfix: Simulation Load Data missed
drbacke Oct 1, 2024
b6c79a8
Update class_haushaltsgeraet.py
NormannK Sep 20, 2024
5f348d5
Update class_battery_soc_predictor.py
NormannK Sep 20, 2024
30a04bf
Update class_akku.py
NormannK Sep 20, 2024
d86f0c8
Update class_heatpump.py
NormannK Sep 20, 2024
526efa7
Update class_inverter.py
NormannK Sep 20, 2024
03dc7b6
Update class_load.py
NormannK Sep 20, 2024
0570be6
Update class_load_container.py
NormannK Sep 20, 2024
fd39182
Update class_load_corrector.py
NormannK Sep 20, 2024
f76fe25
Update class_sommerzeit.py
NormannK Sep 20, 2024
32b4b7c
Update class_strompreis.py
NormannK Sep 20, 2024
8e9f6c3
Bump fonttools from 4.54.0 to 4.54.1
dependabot[bot] Sep 30, 2024
d233a15
Bump opt-einsum from 3.3.0 to 3.4.0
dependabot[bot] Sep 30, 2024
d8a435d
Bump h5py from 3.11.0 to 3.12.1
dependabot[bot] Sep 30, 2024
8a2105b
Bump tensorboard from 2.17.1 to 2.18.0
dependabot[bot] Sep 30, 2024
8203588
Bump pandas from 2.2.2 to 2.2.3
dependabot[bot] Sep 30, 2024
670dd2e
Unittest Akku
drbacke Oct 3, 2024
3736a56
Add first unit test for heatpump COP calculation
fortrieb Oct 2, 2024
e366409
unittest -> pytest
drbacke Oct 3, 2024
7cc7a50
Delete modules/class_battery_soc_predictor.py
NormannK Oct 2, 2024
d9f7f36
Update requirements.txt
NormannK Oct 2, 2024
59a696c
Add pre-commit configuration
michaelosthege Oct 3, 2024
41efea2
Apply isort and ruff code style
michaelosthege Oct 3, 2024
156eddc
Manual edits to remove remaining code style errors
michaelosthege Oct 3, 2024
41c3e15
Removed comments
drbacke Oct 3, 2024
d201bdc
feat: run pytest for PRs
danimo Oct 3, 2024
88045c4
fix: remove verbose comment
danimo Oct 3, 2024
e3f4492
Merge branch 'main' of https://github.com/Akkudoktor-EOS/EOS
drbacke Oct 4, 2024
a71fb01
Unittest EMS
drbacke Oct 4, 2024
c53905b
English + Ruff
drbacke Oct 4, 2024
8ce1c3c
Fix code style
michaelosthege Oct 4, 2024
26b8beb
Add contribution guide and issue templates
michaelosthege Oct 4, 2024
605b89f
bugfix visualize module
NormannK Oct 4, 2024
0149001
Refactored class_optimize.py
NormannK Oct 4, 2024
fde45ff
datetime bug
drbacke Oct 5, 2024
909a0fe
Pre Commit Fix
drbacke Oct 5, 2024
9ae5796
Add docker multi-arch build with github package push and cleaned up D…
Oct 3, 2024
a3792d7
Moves Load_Profiles
drbacke Oct 5, 2024
3614216
Moved load_profile db to data
drbacke Oct 5, 2024
ccbb79b
deleted dead File server_load_profile.py now in flask_server
drbacke Oct 5, 2024
7b26df5
Pre Commit Fixes
drbacke Oct 5, 2024
6e72343
Translate Battery class
fortrieb Oct 6, 2024
529bfdd
Renam test class
fortrieb Oct 6, 2024
dc1327e
Merge branch 'main' of https://github.com/Akkudoktor-EOS/EOS
fortrieb Oct 6, 2024
cd57b85
Merge branch 'main' into tests/akku-migrate-pytest
fortrieb Oct 6, 2024
8433e56
Convert class akku to battery
fortrieb Oct 7, 2024
7203e2f
Merge branch 'main' of https://github.com/Akkudoktor-EOS/EOS
fortrieb Oct 7, 2024
5ef9f51
Merge branch 'main' into refactoring/class_akku
fortrieb Oct 7, 2024
2431216
Change to new imports
fortrieb Oct 7, 2024
ac79231
Remove class akku
fortrieb Oct 7, 2024
ec3bfc4
Pre commit hook
fortrieb Oct 7, 2024
7ab11eb
Remove keep file restored during merge from main
fortrieb Oct 7, 2024
e4c0285
Merge branch 'main' of ghfortrieb:Akkudoktor-EOS/EOS
fortrieb Nov 11, 2024
45216db
Add doc strings and translation
fortrieb Nov 11, 2024
364a5db
Merge branch 'main' of ghfortrieb:Akkudoktor-EOS/EOS
fortrieb Nov 11, 2024
b931383
Merge branch 'main' into refactoring/class_akku
fortrieb Nov 11, 2024
6a35589
Update translation
fortrieb Nov 12, 2024
7e6e9fe
Fix formatting
fortrieb Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' of https://github.com/Akkudoktor-EOS/EOS
fortrieb committed Oct 7, 2024
commit 7203e2fccd36b55aeb0f81bbdf81d7dc9b14d208
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -16,8 +16,10 @@ RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get install ${APT_OPTS} gcc libhdf5-dev libmariadb-dev pkg-config mariadb-common libmariadb3 \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir build \
&& pip install --no-cache-dir -e . \
&& apt remove ${APT_OPTS} gcc libhdf5-dev libmariadb-dev pkg-config

ENTRYPOINT []

CMD ["python", "flask_server.py"]
CMD ["python", "-m", "akkudoktoreos.flask_server"]
33 changes: 27 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the targets
.PHONY: help venv pip docker-run docs clean
.PHONY: help venv pip install dist test docker-run docs clean

# Default target
all: help
@@ -9,10 +9,12 @@ help:
@echo "Available targets:"
@echo " venv - Set up a Python 3 virtual environment."
@echo " pip - Install dependencies from requirements.txt."
@echo " install - Install EOS in editable form (development mode) into virtual environment."
@echo " docker-run - Run entire setup on docker
@echo " docs - Generate HTML documentation using pdoc."
@echo " run - Run flask_server.py in the virtual environment."
@echo " clean - Remove generated documentation and virtual environment."
@echo " run - Run flask_server in the virtual environment (needs install before)."
@echo " dist - Create distribution (in dist/)."
@echo " clean - Remove generated documentation, distribution and virtual environment."

# Target to set up a Python 3 virtual environment
venv:
@@ -21,22 +23,41 @@ venv:

# Target to install dependencies from requirements.txt
pip: venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
@echo "Dependencies installed from requirements.txt."

# Target to install EOS in editable form (development mode) into virtual environment.
install: pip
.venv/bin/pip install build
.venv/bin/pip install -e .
@echo "EOS installed in editable form (development mode)."

# Target to create a distribution.
dist: pip
.venv/bin/pip install build
.venv/bin/python -m build --wheel
@echo "Distribution created (see dist/)."

# Target to generate HTML documentation
docs: pip
pdoc --html --force modules -o docs

# Clean target to remove generated documentation and virtual environment
# Clean target to remove generated documentation, distribution and virtual environment
clean:
@echo "Cleaning virtual env and documentation directories"
@echo "Cleaning virtual env, distribution and documentation directories"
rm -rf docs
rm -rf dist
rm -rf .venv

run:
@echo "Starting flask server, please wait..."
.venv/bin/python ./flask_server.py
.venv/bin/python -m akkudoktoreosserver.flask_server

# Target to run tests.
test:
@echo "Running tests..."
.venv/bin/pytest

# Run entire setup on docker
docker-run:
2 changes: 1 addition & 1 deletion README-DE.md
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ Diese Klassen arbeiten zusammen, um eine detaillierte Simulation und Optimierung
Jede Klasse ist so gestaltet, dass sie leicht angepasst und erweitert werden kann, um zusätzliche Funktionen oder Verbesserungen zu integrieren. Beispielsweise können neue Methoden zur genaueren Modellierung des Verhaltens von PV-Anlagen oder Batteriespeichern hinzugefügt werden. Entwickler sind eingeladen, das System nach ihren Bedürfnissen zu modifizieren und zu erweitern.


# Input für den Flask Server (Stand 30.07.204)
# Input für den Flask Server (Stand 30.07.2024)
Beschreibt die Struktur und Datentypen des JSON-Objekts, das an den Flask-Server gesendet wird. Hier mit einem Prognosezeitraum von 48 Stunden!

## Felder des JSON-Objekts
Binary file removed battery_model.pkl
Binary file not shown.
Binary file removed data/load_profiles.npz
Binary file not shown.
88 changes: 0 additions & 88 deletions modules/class_heatpump.py

This file was deleted.

41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
[project]
name = "akkudoktor-eos"
version = "0.0.1"
authors = [
{ name="Andreas Schmitz", email="author@example.com" },
]
description = "This project provides a comprehensive solution for simulating and optimizing an energy system based on renewable energy sources. With a focus on photovoltaic (PV) systems, battery storage (batteries), load management (consumer requirements), heat pumps, electric vehicles, and consideration of electricity price data, this system enables forecasting and optimization of energy flow and costs over a specified period."
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/Akkudoktor-EOS/EOS"
Issues = "https://github.com/Akkudoktor-EOS/EOS/issues"

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {dev = { file = ["requirements-dev.txt"] }}

[tool.setuptools.packages.find]
where = ["src/"]
include = ["akkudoktoreos", "akkudoktoreosserver", ]

[tool.setuptools.package-data]
akkudoktoreosserver = ["data/*.npz", ]

[tool.isort]
profile = "black"

[tool.ruff.lint]
ignore = [
"F841", # don't complain about unused variables
]

[tool.pytest.ini_options]
minversion = "8.3.3"
addopts = "--cov=src"
pythonpath = [ "src", ]
testpaths = [ "tests", ]
Empty file added src/akkudoktoreos/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 6 additions & 10 deletions modules/class_optimize.py → src/akkudoktoreos/class_optimize.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import os
import random
import sys
from typing import Any, Dict, List, Optional, Tuple

import numpy as np
from deap import algorithms, base, creator, tools

from modules.class_akku import PVAkku
from modules.class_ems import EnergieManagementSystem
from modules.class_haushaltsgeraet import Haushaltsgeraet
from modules.class_inverter import Wechselrichter
from modules.visualize import visualisiere_ergebnisse

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from config import moegliche_ladestroeme_in_prozent
from akkudoktoreos.class_akku import PVAkku
from akkudoktoreos.class_ems import EnergieManagementSystem
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
from akkudoktoreos.class_inverter import Wechselrichter
from akkudoktoreos.config import moegliche_ladestroeme_in_prozent
from akkudoktoreos.visualize import visualisiere_ergebnisse


def isfloat(num: Any) -> bool:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion modules/visualize.py → src/akkudoktoreos/visualize.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages

from modules.class_sommerzeit import ist_dst_wechsel
from akkudoktoreos.class_sommerzeit import ist_dst_wechsel

matplotlib.use("Agg")

22 changes: 11 additions & 11 deletions flask_server.py → src/akkudoktoreosserver/flask_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

import os
import sys
from datetime import datetime

import matplotlib
@@ -12,15 +11,13 @@
import pandas as pd
from flask import Flask, jsonify, redirect, request, send_from_directory, url_for

from modules.class_load import LoadForecast
from modules.class_load_container import Gesamtlast
from modules.class_load_corrector import LoadPredictionAdjuster
from modules.class_optimize import isfloat, optimization_problem
from modules.class_pv_forecast import PVForecast
from modules.class_strompreis import HourlyElectricityPriceForecast

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from config import get_start_enddate, optimization_hours, prediction_hours
from akkudoktoreos.class_load import LoadForecast
from akkudoktoreos.class_load_container import Gesamtlast
from akkudoktoreos.class_load_corrector import LoadPredictionAdjuster
from akkudoktoreos.class_optimize import isfloat, optimization_problem
from akkudoktoreos.class_pv_forecast import PVForecast
from akkudoktoreos.class_strompreis import HourlyElectricityPriceForecast
from akkudoktoreos.config import get_start_enddate, optimization_hours, prediction_hours

app = Flask(__name__)

@@ -126,7 +123,10 @@ def flask_gesamtlast_simple():
###############
# Load Forecast
###############
file_path = os.path.join("data", "load_profiles.npz")
server_dir = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(server_dir, "data", "load_profiles.npz")

print(file_path)

lf = LoadForecast(
filepath=file_path, year_energy=year_energy
2 changes: 1 addition & 1 deletion tests/test_class_akku.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from modules.class_akku import PVAkku
from akkudoktoreos.class_akku import PVAkku


class TestPVAkku(unittest.TestCase):
8 changes: 4 additions & 4 deletions tests/test_class_ems.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest

from modules.class_akku import PVAkku
from modules.class_ems import EnergieManagementSystem
from modules.class_haushaltsgeraet import Haushaltsgeraet
from modules.class_inverter import Wechselrichter # Example import
from akkudoktoreos.class_akku import PVAkku
from akkudoktoreos.class_ems import EnergieManagementSystem
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
from akkudoktoreos.class_inverter import Wechselrichter # Example import

prediction_hours = 48
optimization_hours = 24
2 changes: 1 addition & 1 deletion tests/test_class_optimize.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import pytest

from modules.class_optimize import optimization_problem
from akkudoktoreos.class_optimize import optimization_problem

# Sample known result (replace with the actual expected output)
EXPECTED_RESULT = {
2 changes: 1 addition & 1 deletion tests/test_heatpump.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from modules.heatpump import Heatpump
from akkudoktoreos.heatpump import Heatpump


@pytest.fixture(scope="function")
You are viewing a condensed version of this merge commit. You can view the full changes here.