mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-08-25 23:11:14 +00:00
Improve Configuration and Prediction Usability (#220)
* Update utilities in utils submodule. * Add base configuration modules. * Add server base configuration modules. * Add devices base configuration modules. * Add optimization base configuration modules. * Add utils base configuration modules. * Add prediction abstract and base classes plus tests. * Add PV forecast to prediction submodule. The PV forecast modules are adapted from the class_pvforecast module and replace it. * Add weather forecast to prediction submodule. The modules provide classes and methods to retrieve, manage, and process weather forecast data from various sources. Includes are structured representations of weather data and utilities for fetching forecasts for specific locations and time ranges. BrightSky and ClearOutside are currently supported. * Add electricity price forecast to prediction submodule. * Adapt fastapi server to base config and add fasthtml server. * Add ems to core submodule. * Adapt genetic to config. * Adapt visualize to config. * Adapt common test fixtures to config. * Add load forecast to prediction submodule. * Add core abstract and base classes. * Adapt single test optimization to config. * Adapt devices to config. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -1,24 +1,17 @@
|
||||
from http import HTTPStatus
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
|
||||
from akkudoktoreos.config import CONFIG_FILE_NAME, load_config
|
||||
from akkudoktoreos.config.config import get_config
|
||||
|
||||
config_eos = get_config()
|
||||
|
||||
|
||||
def test_fixture_setup(server, tmp_path: Path) -> None:
|
||||
"""Test if the fixture sets up the server with the env var."""
|
||||
# validate correct path in server
|
||||
config = load_config(tmp_path, False)
|
||||
assert tmp_path.joinpath(CONFIG_FILE_NAME).is_file()
|
||||
cache = tmp_path / config.directories.cache
|
||||
assert cache.is_dir()
|
||||
|
||||
|
||||
def test_server(server, tmp_path: Path):
|
||||
def test_server(server):
|
||||
"""Test the server."""
|
||||
result = requests.get(f"{server}/gesamtlast_simple?year_energy=2000&")
|
||||
assert result.status_code == HTTPStatus.OK
|
||||
# validate correct path in server
|
||||
assert config_eos.data_folder_path is not None
|
||||
assert config_eos.data_folder_path.is_dir()
|
||||
|
||||
config = load_config(tmp_path, False)
|
||||
assert len(result.json()) == config.eos.prediction_hours
|
||||
result = requests.get(f"{server}/config?")
|
||||
assert result.status_code == HTTPStatus.OK
|
||||
|
Reference in New Issue
Block a user