Skip to content

Commit

Permalink
Adapt data to package directory structure.
Browse files Browse the repository at this point in the history
Move static data to server package directory.
Assure data/*.npz data is included in the server package.

Signed-off-by: Bobby Noelte <[email protected]>
  • Loading branch information
b0661 committed Oct 7, 2024
1 parent efd32b9 commit d463758
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Binary file removed data/load_profiles.npz
Binary file not shown.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion src/akkudoktoreosserver/flask_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d463758

Please sign in to comment.