Adapt data to package directory structure.

Move static data to server package directory.
Assure data/*.npz data is included in the server package.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte 2024-10-07 12:24:45 +02:00 committed by Andreas
parent 7c13cb6e1c
commit b9f65ef7db
3 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -30,6 +30,9 @@ optional-dependencies = {dev = { file = ["requirements-dev.txt"] }}
where = ["src/"]
include = ["akkudoktoreos", "akkudoktoreosserver", ]
[tool.setuptools.package-data]
akkudoktoreosserver = ["data/*.npz", ]
[tool.isort]
profile = "black"

View File

@ -123,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