mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
* temperature, relativehumidity_2m, windspeed_10m can be null * prettify pv_forecast_input_1.json (and add null value)
This commit is contained in:
parent
b386c4be70
commit
267a9bf427
@ -3331,8 +3331,15 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"temperature": {
|
"temperature": {
|
||||||
"items": {
|
"items": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"title": "Temperature"
|
"title": "Temperature"
|
||||||
},
|
},
|
||||||
@ -3462,8 +3469,15 @@
|
|||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"items": {
|
"items": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ class OptimizationParameters(BaseModel):
|
|||||||
inverter: InverterParameters = InverterParameters()
|
inverter: InverterParameters = InverterParameters()
|
||||||
eauto: Optional[ElectricVehicleParameters]
|
eauto: Optional[ElectricVehicleParameters]
|
||||||
dishwasher: Optional[HomeApplianceParameters] = None
|
dishwasher: Optional[HomeApplianceParameters] = None
|
||||||
temperature_forecast: Optional[list[float]] = Field(
|
temperature_forecast: Optional[list[Optional[float]]] = Field(
|
||||||
default=None,
|
default=None,
|
||||||
description="An array of floats representing the temperature forecast in degrees Celsius for different time intervals.",
|
description="An array of floats representing the temperature forecast in degrees Celsius for different time intervals.",
|
||||||
)
|
)
|
||||||
|
@ -109,9 +109,9 @@ class AkkudoktorForecastValue(PydanticBaseModel):
|
|||||||
power: float
|
power: float
|
||||||
sunTilt: float
|
sunTilt: float
|
||||||
sunAzimuth: float
|
sunAzimuth: float
|
||||||
temperature: float
|
temperature: Optional[float]
|
||||||
relativehumidity_2m: float
|
relativehumidity_2m: Optional[float]
|
||||||
windspeed_10m: float
|
windspeed_10m: Optional[float]
|
||||||
|
|
||||||
|
|
||||||
class AkkudoktorForecast(PydanticBaseModel):
|
class AkkudoktorForecast(PydanticBaseModel):
|
||||||
|
@ -407,7 +407,7 @@ def fastapi_gesamtlast_simple(year_energy: float) -> list[float]:
|
|||||||
|
|
||||||
|
|
||||||
class ForecastResponse(PydanticBaseModel):
|
class ForecastResponse(PydanticBaseModel):
|
||||||
temperature: list[float]
|
temperature: list[Optional[float]]
|
||||||
pvpower: list[float]
|
pvpower: list[float]
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class VisualizationReport(ConfigMixin):
|
|||||||
def create_line_chart(
|
def create_line_chart(
|
||||||
self,
|
self,
|
||||||
start_hour: Optional[int],
|
start_hour: Optional[int],
|
||||||
y_list: list[Union[np.ndarray, list[float]]],
|
y_list: list[Union[np.ndarray, list[Optional[float]], list[float]]],
|
||||||
title: str,
|
title: str,
|
||||||
xlabel: str,
|
xlabel: str,
|
||||||
ylabel: str,
|
ylabel: str,
|
||||||
|
@ -293,10 +293,9 @@ def test_timezone_behaviour(
|
|||||||
forecast_temps = provider.key_to_series(
|
forecast_temps = provider.key_to_series(
|
||||||
"pvforecastakkudoktor_temp_air", other_start_datetime, other_end_datetime
|
"pvforecastakkudoktor_temp_air", other_start_datetime, other_end_datetime
|
||||||
)
|
)
|
||||||
assert len(forecast_temps) == 24
|
assert len(forecast_temps) == 23 # 24-1, first temperature is null
|
||||||
assert forecast_temps.iloc[0] == 7.0
|
assert forecast_temps.iloc[0] == 6.5
|
||||||
assert forecast_temps.iloc[1] == 6.5
|
assert forecast_temps.iloc[1] == 6.0
|
||||||
assert forecast_temps.iloc[2] == 6.0
|
|
||||||
|
|
||||||
# Test fetching AC power forecast
|
# Test fetching AC power forecast
|
||||||
other_end_datetime = other_start_datetime + to_duration("48 hours")
|
other_end_datetime = other_start_datetime + to_duration("48 hours")
|
||||||
|
11663
tests/testdata/pv_forecast_input_1.json
vendored
11663
tests/testdata/pv_forecast_input_1.json
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user