mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-09-13 07:21:16 +00:00
EOSdash: Improve PV forecast configuration. (#500)
* Allow to configure planes and configuration values of planes separatedly. Make single configuration values for planes explicitly available for configuration. Still allows to also configure a plane by a whole plane value struct. * Enhance admin page by file import and export of the EOS configuration The actual EOS configuration can now be exported to the EOSdash server. From there it can be also imported. For security reasons only import and export from/ to a predefined directory on the EOSdash server is possible. * Improve handling of nested value pathes in pydantic models. Added separate methods for nested path access (get_nested_value, set_nested_value). On value setting the missing fields along the nested path are now added automatically and initialized with default values. Nested path access was before restricted to the EOS configuration and is now part of the pydantic base model. * Makefile Add new target to run rests as CI does on Github. Improve target docs. * Datetimeutil tests Prolong acceptable time difference for comparison of approximately equal times in tests. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -138,23 +138,11 @@ def test_mixed_plane_configuration(settings):
|
||||
assert settings.planes_peakpower == [5.0, 5000.0, 3.0]
|
||||
|
||||
|
||||
def test_max_planes_limit(settings):
|
||||
"""Test that the maximum number of planes is enforced."""
|
||||
assert settings.max_planes == 6
|
||||
|
||||
# Create settings with more planes than allowed (should only recognize up to max)
|
||||
plane_settings = [{"peakpower": 5.0} for _ in range(8)]
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
PVForecastCommonSettings(planes=plane_settings)
|
||||
|
||||
|
||||
def test_invalid_plane_settings():
|
||||
def test_none_plane_settings():
|
||||
"""Test that optional parameters can be None for non-zero planes."""
|
||||
with pytest.raises(ValueError):
|
||||
PVForecastPlaneSetting(
|
||||
peakpower=5.0,
|
||||
albedo=None,
|
||||
module_model=None,
|
||||
userhorizon=None,
|
||||
)
|
||||
setting = PVForecastPlaneSetting(
|
||||
peakpower=5.0,
|
||||
albedo=None,
|
||||
module_model=None,
|
||||
userhorizon=None,
|
||||
)
|
||||
|
Reference in New Issue
Block a user