s2-python 0.4.1__py3-none-any.whl → 0.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {s2_python-0.4.1.dist-info → s2_python-0.6.0.dist-info}/METADATA +17 -12
- s2_python-0.6.0.dist-info/RECORD +89 -0
- {s2_python-0.4.1.dist-info → s2_python-0.6.0.dist-info}/WHEEL +1 -1
- s2_python-0.6.0.dist-info/licenses/LICENSE +201 -0
- s2python/common/__init__.py +32 -0
- s2python/common/duration.py +3 -1
- s2python/common/handshake.py +2 -2
- s2python/common/handshake_response.py +2 -2
- s2python/common/instruction_status_update.py +3 -3
- s2python/common/number_range.py +5 -2
- s2python/common/power_forecast.py +3 -3
- s2python/common/power_forecast_element.py +28 -6
- s2python/common/power_forecast_value.py +1 -1
- s2python/common/power_measurement.py +27 -5
- s2python/common/power_range.py +4 -2
- s2python/common/power_value.py +1 -1
- s2python/common/reception_status.py +2 -2
- s2python/common/resource_manager_details.py +6 -6
- s2python/common/revoke_object.py +3 -3
- s2python/common/role.py +1 -1
- s2python/common/select_control_type.py +2 -2
- s2python/common/session_request.py +2 -2
- s2python/common/timer.py +3 -3
- s2python/common/transition.py +8 -8
- s2python/ddbc/__init__.py +21 -0
- s2python/ddbc/ddbc_actuator_description.py +30 -0
- s2python/ddbc/ddbc_actuator_status.py +22 -0
- s2python/ddbc/ddbc_average_demand_rate_forecast.py +28 -0
- s2python/ddbc/ddbc_average_demand_rate_forecast_element.py +21 -0
- s2python/ddbc/ddbc_instruction.py +19 -0
- s2python/ddbc/ddbc_operation_mode.py +26 -0
- s2python/ddbc/ddbc_system_description.py +29 -0
- s2python/ddbc/ddbc_timer_status.py +18 -0
- s2python/frbc/__init__.py +19 -3
- s2python/frbc/frbc_actuator_description.py +15 -9
- s2python/frbc/frbc_actuator_status.py +5 -5
- s2python/frbc/frbc_fill_level_target_profile.py +3 -3
- s2python/frbc/frbc_fill_level_target_profile_element.py +7 -6
- s2python/frbc/frbc_instruction.py +5 -5
- s2python/frbc/frbc_leakage_behaviour.py +3 -3
- s2python/frbc/frbc_leakage_behaviour_element.py +9 -6
- s2python/frbc/frbc_operation_mode.py +13 -6
- s2python/frbc/frbc_operation_mode_element.py +5 -5
- s2python/frbc/frbc_storage_description.py +2 -2
- s2python/frbc/frbc_storage_status.py +2 -2
- s2python/frbc/frbc_system_description.py +4 -4
- s2python/frbc/frbc_timer_status.py +4 -4
- s2python/frbc/frbc_usage_forecast.py +3 -3
- s2python/frbc/frbc_usage_forecast_element.py +2 -2
- s2python/generated/gen_s2.py +508 -543
- s2python/message.py +101 -6
- s2python/ombc/__init__.py +5 -0
- s2python/ombc/ombc_instruction.py +19 -0
- s2python/ombc/ombc_operation_mode.py +25 -0
- s2python/ombc/ombc_status.py +17 -0
- s2python/ombc/ombc_system_description.py +25 -0
- s2python/ombc/ombc_timer_status.py +17 -0
- s2python/pebc/__init__.py +21 -0
- s2python/pebc/pebc_allowed_limit_range.py +42 -0
- s2python/pebc/pebc_energy_constraint.py +25 -0
- s2python/pebc/pebc_instruction.py +27 -0
- s2python/pebc/pebc_power_constraints.py +77 -0
- s2python/pebc/pebc_power_envelope.py +23 -0
- s2python/pebc/pebc_power_envelope_element.py +16 -0
- s2python/ppbc/__init__.py +15 -6
- s2python/ppbc/ppbc_end_interruption_instruction.py +6 -8
- s2python/ppbc/ppbc_power_profile_definition.py +4 -6
- s2python/ppbc/ppbc_power_profile_status.py +2 -4
- s2python/ppbc/ppbc_power_sequence.py +6 -6
- s2python/ppbc/ppbc_power_sequence_container.py +5 -7
- s2python/ppbc/ppbc_power_sequence_container_status.py +7 -9
- s2python/ppbc/ppbc_power_sequence_element.py +3 -5
- s2python/ppbc/ppbc_schedule_instruction.py +6 -8
- s2python/ppbc/ppbc_start_interruption_instruction.py +6 -8
- s2python/s2_connection.py +93 -32
- s2python/s2_control_type.py +36 -0
- s2python/s2_parser.py +4 -0
- s2python/s2_validation_error.py +3 -1
- s2python/validate_values_mixin.py +29 -14
- s2_python-0.4.1.dist-info/RECORD +0 -66
- {s2_python-0.4.1.dist-info → s2_python-0.6.0.dist-info}/entry_points.txt +0 -0
- {s2_python-0.4.1.dist-info → s2_python-0.6.0.dist-info}/top_level.txt +0 -0
@@ -13,13 +13,13 @@ from s2python.validate_values_mixin import (
|
|
13
13
|
|
14
14
|
|
15
15
|
@catch_and_convert_exceptions
|
16
|
-
class ResourceManagerDetails(GenResourceManagerDetails, S2MessageComponent
|
16
|
+
class ResourceManagerDetails(GenResourceManagerDetails, S2MessageComponent):
|
17
17
|
model_config = GenResourceManagerDetails.model_config
|
18
18
|
model_config["validate_assignment"] = True
|
19
19
|
|
20
|
-
instruction_processing_delay: Duration = GenResourceManagerDetails.model_fields[
|
20
|
+
instruction_processing_delay: Duration = GenResourceManagerDetails.model_fields[ # type: ignore[assignment,reportIncompatibleVariableOverride]
|
21
21
|
"instruction_processing_delay"
|
22
|
-
]
|
23
|
-
message_id: uuid.UUID = GenResourceManagerDetails.model_fields["message_id"] # type: ignore[assignment]
|
24
|
-
resource_id: uuid.UUID = GenResourceManagerDetails.model_fields["resource_id"] # type: ignore[assignment]
|
25
|
-
roles: List[Role] = GenResourceManagerDetails.model_fields["roles"] # type: ignore[assignment]
|
22
|
+
]
|
23
|
+
message_id: uuid.UUID = GenResourceManagerDetails.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
24
|
+
resource_id: uuid.UUID = GenResourceManagerDetails.model_fields["resource_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
25
|
+
roles: List[Role] = GenResourceManagerDetails.model_fields["roles"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
s2python/common/revoke_object.py
CHANGED
@@ -8,9 +8,9 @@ from s2python.validate_values_mixin import (
|
|
8
8
|
|
9
9
|
|
10
10
|
@catch_and_convert_exceptions
|
11
|
-
class RevokeObject(GenRevokeObject, S2MessageComponent
|
11
|
+
class RevokeObject(GenRevokeObject, S2MessageComponent):
|
12
12
|
model_config = GenRevokeObject.model_config
|
13
13
|
model_config["validate_assignment"] = True
|
14
14
|
|
15
|
-
message_id: uuid.UUID = GenRevokeObject.model_fields["message_id"] # type: ignore[assignment]
|
16
|
-
object_id: uuid.UUID = GenRevokeObject.model_fields["object_id"] # type: ignore[assignment]
|
15
|
+
message_id: uuid.UUID = GenRevokeObject.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
16
|
+
object_id: uuid.UUID = GenRevokeObject.model_fields["object_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
s2python/common/role.py
CHANGED
@@ -8,8 +8,8 @@ from s2python.validate_values_mixin import (
|
|
8
8
|
|
9
9
|
|
10
10
|
@catch_and_convert_exceptions
|
11
|
-
class SelectControlType(GenSelectControlType, S2MessageComponent
|
11
|
+
class SelectControlType(GenSelectControlType, S2MessageComponent):
|
12
12
|
model_config = GenSelectControlType.model_config
|
13
13
|
model_config["validate_assignment"] = True
|
14
14
|
|
15
|
-
message_id: uuid.UUID = GenSelectControlType.model_fields["message_id"] # type: ignore[assignment]
|
15
|
+
message_id: uuid.UUID = GenSelectControlType.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -8,8 +8,8 @@ from s2python.validate_values_mixin import (
|
|
8
8
|
|
9
9
|
|
10
10
|
@catch_and_convert_exceptions
|
11
|
-
class SessionRequest(GenSessionRequest, S2MessageComponent
|
11
|
+
class SessionRequest(GenSessionRequest, S2MessageComponent):
|
12
12
|
model_config = GenSessionRequest.model_config
|
13
13
|
model_config["validate_assignment"] = True
|
14
14
|
|
15
|
-
message_id: uuid.UUID = GenSessionRequest.model_fields["message_id"] # type: ignore[assignment]
|
15
|
+
message_id: uuid.UUID = GenSessionRequest.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
s2python/common/timer.py
CHANGED
@@ -9,9 +9,9 @@ from s2python.validate_values_mixin import (
|
|
9
9
|
|
10
10
|
|
11
11
|
@catch_and_convert_exceptions
|
12
|
-
class Timer(GenTimer, S2MessageComponent
|
12
|
+
class Timer(GenTimer, S2MessageComponent):
|
13
13
|
model_config = GenTimer.model_config
|
14
14
|
model_config["validate_assignment"] = True
|
15
15
|
|
16
|
-
id: uuid.UUID = GenTimer.model_fields["id"] # type: ignore[assignment]
|
17
|
-
duration: Duration = GenTimer.model_fields["duration"] # type: ignore[assignment]
|
16
|
+
id: uuid.UUID = GenTimer.model_fields["id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
17
|
+
duration: Duration = GenTimer.model_fields["duration"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
s2python/common/transition.py
CHANGED
@@ -10,15 +10,15 @@ from s2python.validate_values_mixin import (
|
|
10
10
|
|
11
11
|
|
12
12
|
@catch_and_convert_exceptions
|
13
|
-
class Transition(GenTransition, S2MessageComponent
|
13
|
+
class Transition(GenTransition, S2MessageComponent):
|
14
14
|
model_config = GenTransition.model_config
|
15
15
|
model_config["validate_assignment"] = True
|
16
16
|
|
17
|
-
id: uuid.UUID = GenTransition.model_fields["id"] # type: ignore[assignment]
|
18
|
-
from_: uuid.UUID = GenTransition.model_fields["from_"] # type: ignore[assignment]
|
19
|
-
to: uuid.UUID = GenTransition.model_fields["to"] # type: ignore[assignment]
|
20
|
-
start_timers: List[uuid.UUID] = GenTransition.model_fields["start_timers"] # type: ignore[assignment]
|
21
|
-
blocking_timers: List[uuid.UUID] = GenTransition.model_fields["blocking_timers"] # type: ignore[assignment]
|
22
|
-
transition_duration: Optional[Duration] = GenTransition.model_fields[
|
17
|
+
id: uuid.UUID = GenTransition.model_fields["id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
18
|
+
from_: uuid.UUID = GenTransition.model_fields["from_"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
19
|
+
to: uuid.UUID = GenTransition.model_fields["to"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
20
|
+
start_timers: List[uuid.UUID] = GenTransition.model_fields["start_timers"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
21
|
+
blocking_timers: List[uuid.UUID] = GenTransition.model_fields["blocking_timers"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
22
|
+
transition_duration: Optional[Duration] = GenTransition.model_fields[ # type: ignore[assignment,reportIncompatibleVariableOverride]
|
23
23
|
"transition_duration"
|
24
|
-
]
|
24
|
+
]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from s2python.ddbc.ddbc_actuator_description import DDBCActuatorDescription
|
2
|
+
from s2python.ddbc.ddbc_operation_mode import DDBCOperationMode
|
3
|
+
from s2python.ddbc.ddbc_instruction import DDBCInstruction
|
4
|
+
from s2python.ddbc.ddbc_actuator_status import DDBCActuatorStatus
|
5
|
+
from s2python.ddbc.ddbc_average_demand_rate_forecast_element import (
|
6
|
+
DDBCAverageDemandRateForecastElement,
|
7
|
+
)
|
8
|
+
from s2python.ddbc.ddbc_average_demand_rate_forecast import DDBCAverageDemandRateForecast
|
9
|
+
from s2python.ddbc.ddbc_system_description import DDBCSystemDescription
|
10
|
+
from s2python.ddbc.ddbc_timer_status import DDBCTimerStatus
|
11
|
+
|
12
|
+
__all__ = [
|
13
|
+
"DDBCActuatorDescription",
|
14
|
+
"DDBCOperationMode",
|
15
|
+
"DDBCInstruction",
|
16
|
+
"DDBCActuatorStatus",
|
17
|
+
"DDBCAverageDemandRateForecastElement",
|
18
|
+
"DDBCAverageDemandRateForecast",
|
19
|
+
"DDBCSystemDescription",
|
20
|
+
"DDBCTimerStatus",
|
21
|
+
]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
from typing import List
|
2
|
+
import uuid
|
3
|
+
|
4
|
+
from s2python.generated.gen_s2 import (
|
5
|
+
DDBCActuatorDescription as GenDDBCActuatorDescription,
|
6
|
+
)
|
7
|
+
from s2python.generated.gen_s2 import Commodity
|
8
|
+
from s2python.ddbc.ddbc_operation_mode import DDBCOperationMode
|
9
|
+
|
10
|
+
from s2python.common.timer import Timer
|
11
|
+
|
12
|
+
from s2python.validate_values_mixin import (
|
13
|
+
catch_and_convert_exceptions,
|
14
|
+
S2MessageComponent,
|
15
|
+
)
|
16
|
+
|
17
|
+
|
18
|
+
@catch_and_convert_exceptions
|
19
|
+
class DDBCActuatorDescription(GenDDBCActuatorDescription, S2MessageComponent):
|
20
|
+
model_config = GenDDBCActuatorDescription.model_config
|
21
|
+
model_config["validate_assignment"] = True
|
22
|
+
|
23
|
+
id: uuid.UUID = GenDDBCActuatorDescription.model_fields["id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
24
|
+
supported_commodites: List[Commodity] = GenDDBCActuatorDescription.model_fields[
|
25
|
+
"supported_commodites"
|
26
|
+
] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
27
|
+
timers: List[Timer] = GenDDBCActuatorDescription.model_fields["timers"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
28
|
+
operation_modes: List[DDBCOperationMode] = GenDDBCActuatorDescription.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
29
|
+
"operation_modes"
|
30
|
+
] # type: ignore[assignment]
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import uuid
|
2
|
+
|
3
|
+
from s2python.generated.gen_s2 import DDBCActuatorStatus as GenDDBCActuatorStatus
|
4
|
+
from s2python.validate_values_mixin import (
|
5
|
+
catch_and_convert_exceptions,
|
6
|
+
S2MessageComponent,
|
7
|
+
)
|
8
|
+
|
9
|
+
|
10
|
+
@catch_and_convert_exceptions
|
11
|
+
class DDBCActuatorStatus(GenDDBCActuatorStatus, S2MessageComponent):
|
12
|
+
model_config = GenDDBCActuatorStatus.model_config
|
13
|
+
model_config["validate_assignment"] = True
|
14
|
+
|
15
|
+
message_id: uuid.UUID = GenDDBCActuatorStatus.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
16
|
+
actuator_id: uuid.UUID = GenDDBCActuatorStatus.model_fields["actuator_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
17
|
+
active_operation_mode_id: uuid.UUID = GenDDBCActuatorStatus.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
18
|
+
"active_operation_mode_id"
|
19
|
+
] # type: ignore[assignment]
|
20
|
+
operation_mode_factor: float = GenDDBCActuatorStatus.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
21
|
+
"operation_mode_factor"
|
22
|
+
] # type: ignore[assignment]
|
@@ -0,0 +1,28 @@
|
|
1
|
+
from typing import List
|
2
|
+
import uuid
|
3
|
+
|
4
|
+
from s2python.generated.gen_s2 import (
|
5
|
+
DDBCAverageDemandRateForecast as GenDDBCAverageDemandRateForecast,
|
6
|
+
)
|
7
|
+
from s2python.ddbc.ddbc_average_demand_rate_forecast_element import (
|
8
|
+
DDBCAverageDemandRateForecastElement,
|
9
|
+
)
|
10
|
+
|
11
|
+
from s2python.validate_values_mixin import (
|
12
|
+
catch_and_convert_exceptions,
|
13
|
+
S2MessageComponent,
|
14
|
+
)
|
15
|
+
|
16
|
+
|
17
|
+
@catch_and_convert_exceptions
|
18
|
+
class DDBCAverageDemandRateForecast(
|
19
|
+
GenDDBCAverageDemandRateForecast,
|
20
|
+
S2MessageComponent,
|
21
|
+
):
|
22
|
+
model_config = GenDDBCAverageDemandRateForecast.model_config
|
23
|
+
model_config["validate_assignment"] = True
|
24
|
+
|
25
|
+
message_id: uuid.UUID = GenDDBCAverageDemandRateForecast.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
26
|
+
elements: List[DDBCAverageDemandRateForecastElement] = ( # type: ignore[reportIncompatibleVariableOverride]
|
27
|
+
GenDDBCAverageDemandRateForecast.model_fields["elements"] # type: ignore[assignment]
|
28
|
+
)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from s2python.generated.gen_s2 import Duration
|
2
|
+
|
3
|
+
from s2python.generated.gen_s2 import (
|
4
|
+
DDBCAverageDemandRateForecastElement as GenDDBCAverageDemandRateForecastElement,
|
5
|
+
)
|
6
|
+
|
7
|
+
from s2python.validate_values_mixin import catch_and_convert_exceptions, S2MessageComponent
|
8
|
+
|
9
|
+
|
10
|
+
@catch_and_convert_exceptions
|
11
|
+
class DDBCAverageDemandRateForecastElement(
|
12
|
+
GenDDBCAverageDemandRateForecastElement,
|
13
|
+
S2MessageComponent,
|
14
|
+
):
|
15
|
+
model_config = GenDDBCAverageDemandRateForecastElement.model_config
|
16
|
+
model_config["validate_assignment"] = True
|
17
|
+
|
18
|
+
duration: Duration = GenDDBCAverageDemandRateForecastElement.model_fields["duration"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
19
|
+
demand_rate_expected: float = GenDDBCAverageDemandRateForecastElement.model_fields[
|
20
|
+
"demand_rate_expected"
|
21
|
+
] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import uuid
|
2
|
+
|
3
|
+
from s2python.generated.gen_s2 import DDBCInstruction as GenDDBCInstruction
|
4
|
+
from s2python.validate_values_mixin import (
|
5
|
+
catch_and_convert_exceptions,
|
6
|
+
S2MessageComponent,
|
7
|
+
)
|
8
|
+
|
9
|
+
|
10
|
+
@catch_and_convert_exceptions
|
11
|
+
class DDBCInstruction(GenDDBCInstruction, S2MessageComponent):
|
12
|
+
model_config = GenDDBCInstruction.model_config
|
13
|
+
model_config["validate_assignment"] = True
|
14
|
+
|
15
|
+
message_id: uuid.UUID = GenDDBCInstruction.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
16
|
+
actuator_id: uuid.UUID = GenDDBCInstruction.model_fields["actuator_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
17
|
+
operation_mode_id: uuid.UUID = GenDDBCInstruction.model_fields["operation_mode_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
18
|
+
operation_mode_factor: float = GenDDBCInstruction.model_fields["operation_mode_factor"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
19
|
+
abnormal_condition: bool = GenDDBCInstruction.model_fields["abnormal_condition"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -0,0 +1,26 @@
|
|
1
|
+
from typing import List
|
2
|
+
import uuid
|
3
|
+
|
4
|
+
from s2python.generated.gen_s2 import DDBCOperationMode as GenDDBCOperationMode
|
5
|
+
|
6
|
+
from s2python.common.power_range import PowerRange
|
7
|
+
from s2python.common.number_range import NumberRange
|
8
|
+
|
9
|
+
from s2python.validate_values_mixin import (
|
10
|
+
catch_and_convert_exceptions,
|
11
|
+
S2MessageComponent,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
@catch_and_convert_exceptions
|
16
|
+
class DDBCOperationMode(GenDDBCOperationMode, S2MessageComponent):
|
17
|
+
model_config = GenDDBCOperationMode.model_config
|
18
|
+
model_config["validate_assignment"] = True
|
19
|
+
|
20
|
+
# ? Id vs id
|
21
|
+
id: uuid.UUID = GenDDBCOperationMode.model_fields["Id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
22
|
+
power_ranges: List[PowerRange] = GenDDBCOperationMode.model_fields["power_ranges"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
23
|
+
supply_range: List[NumberRange] = GenDDBCOperationMode.model_fields["supply_range"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
24
|
+
abnormal_condition_only: bool = GenDDBCOperationMode.model_fields[
|
25
|
+
"abnormal_condition_only"
|
26
|
+
] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from typing import List
|
2
|
+
import uuid
|
3
|
+
|
4
|
+
from s2python.generated.gen_s2 import (
|
5
|
+
DDBCSystemDescription as GenDDBCSystemDescription,
|
6
|
+
)
|
7
|
+
from s2python.common.number_range import NumberRange
|
8
|
+
from s2python.ddbc.ddbc_actuator_description import DDBCActuatorDescription
|
9
|
+
from s2python.validate_values_mixin import (
|
10
|
+
catch_and_convert_exceptions,
|
11
|
+
S2MessageComponent,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
@catch_and_convert_exceptions
|
16
|
+
class DDBCSystemDescription(GenDDBCSystemDescription, S2MessageComponent):
|
17
|
+
model_config = GenDDBCSystemDescription.model_config
|
18
|
+
model_config["validate_assignment"] = True
|
19
|
+
|
20
|
+
message_id: uuid.UUID = GenDDBCSystemDescription.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
21
|
+
actuators: List[DDBCActuatorDescription] = GenDDBCSystemDescription.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
22
|
+
"actuators"
|
23
|
+
] # type: ignore[assignment]
|
24
|
+
present_demand_rate: NumberRange = GenDDBCSystemDescription.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
25
|
+
"present_demand_rate"
|
26
|
+
] # type: ignore[assignment]
|
27
|
+
provides_average_demand_rate_forecast: bool = GenDDBCSystemDescription.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
28
|
+
"provides_average_demand_rate_forecast"
|
29
|
+
] # type: ignore[assignment]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import uuid
|
2
|
+
|
3
|
+
from s2python.generated.gen_s2 import DDBCTimerStatus as GenDDBCTimerStatus
|
4
|
+
|
5
|
+
from s2python.validate_values_mixin import (
|
6
|
+
catch_and_convert_exceptions,
|
7
|
+
S2MessageComponent,
|
8
|
+
)
|
9
|
+
|
10
|
+
|
11
|
+
@catch_and_convert_exceptions
|
12
|
+
class DDBCTimerStatus(GenDDBCTimerStatus, S2MessageComponent):
|
13
|
+
model_config = GenDDBCTimerStatus.model_config
|
14
|
+
model_config["validate_assignment"] = True
|
15
|
+
|
16
|
+
message_id: uuid.UUID = GenDDBCTimerStatus.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
17
|
+
timer_id: uuid.UUID = GenDDBCTimerStatus.model_fields["timer_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
18
|
+
actuator_id: uuid.UUID = GenDDBCTimerStatus.model_fields["actuator_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
s2python/frbc/__init__.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
from s2python.frbc.frbc_fill_level_target_profile_element import
|
2
|
-
FRBCFillLevelTargetProfileElement,
|
3
|
-
)
|
1
|
+
from s2python.frbc.frbc_fill_level_target_profile_element import FRBCFillLevelTargetProfileElement
|
4
2
|
from s2python.frbc.frbc_fill_level_target_profile import FRBCFillLevelTargetProfile
|
5
3
|
from s2python.frbc.frbc_instruction import FRBCInstruction
|
6
4
|
from s2python.frbc.frbc_leakage_behaviour_element import FRBCLeakageBehaviourElement
|
@@ -15,3 +13,21 @@ from s2python.frbc.frbc_storage_description import FRBCStorageDescription
|
|
15
13
|
from s2python.frbc.frbc_storage_status import FRBCStorageStatus
|
16
14
|
from s2python.frbc.frbc_system_description import FRBCSystemDescription
|
17
15
|
from s2python.frbc.frbc_timer_status import FRBCTimerStatus
|
16
|
+
|
17
|
+
__all__ = [
|
18
|
+
"FRBCFillLevelTargetProfileElement",
|
19
|
+
"FRBCFillLevelTargetProfile",
|
20
|
+
"FRBCInstruction",
|
21
|
+
"FRBCLeakageBehaviourElement",
|
22
|
+
"FRBCLeakageBehaviour",
|
23
|
+
"FRBCUsageForecastElement",
|
24
|
+
"FRBCUsageForecast",
|
25
|
+
"FRBCOperationModeElement",
|
26
|
+
"FRBCOperationMode",
|
27
|
+
"FRBCActuatorDescription",
|
28
|
+
"FRBCActuatorStatus",
|
29
|
+
"FRBCStorageDescription",
|
30
|
+
"FRBCStorageStatus",
|
31
|
+
"FRBCSystemDescription",
|
32
|
+
"FRBCTimerStatus",
|
33
|
+
]
|
@@ -18,19 +18,19 @@ from s2python.validate_values_mixin import (
|
|
18
18
|
|
19
19
|
|
20
20
|
@catch_and_convert_exceptions
|
21
|
-
class FRBCActuatorDescription(GenFRBCActuatorDescription, S2MessageComponent
|
21
|
+
class FRBCActuatorDescription(GenFRBCActuatorDescription, S2MessageComponent):
|
22
22
|
model_config = GenFRBCActuatorDescription.model_config
|
23
23
|
model_config["validate_assignment"] = True
|
24
24
|
|
25
|
-
id: uuid.UUID = GenFRBCActuatorDescription.model_fields["id"] # type: ignore[assignment]
|
26
|
-
operation_modes: List[FRBCOperationMode] = GenFRBCActuatorDescription.model_fields[
|
25
|
+
id: uuid.UUID = GenFRBCActuatorDescription.model_fields["id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
26
|
+
operation_modes: List[FRBCOperationMode] = GenFRBCActuatorDescription.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
27
27
|
"operation_modes"
|
28
28
|
] # type: ignore[assignment]
|
29
|
-
transitions: List[Transition] = GenFRBCActuatorDescription.model_fields["transitions"] # type: ignore[assignment]
|
30
|
-
timers: List[Timer] = GenFRBCActuatorDescription.model_fields["timers"] # type: ignore[assignment]
|
29
|
+
transitions: List[Transition] = GenFRBCActuatorDescription.model_fields["transitions"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
30
|
+
timers: List[Timer] = GenFRBCActuatorDescription.model_fields["timers"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
31
31
|
supported_commodities: List[Commodity] = GenFRBCActuatorDescription.model_fields[
|
32
32
|
"supported_commodities"
|
33
|
-
] # type: ignore[assignment]
|
33
|
+
] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
34
34
|
|
35
35
|
@model_validator(mode="after")
|
36
36
|
def validate_timers_in_transitions(self) -> Self:
|
@@ -61,14 +61,18 @@ class FRBCActuatorDescription(GenFRBCActuatorDescription, S2MessageComponent["FR
|
|
61
61
|
timer: Timer
|
62
62
|
for timer in self.timers:
|
63
63
|
if timer.id in ids:
|
64
|
-
raise ValueError(
|
64
|
+
raise ValueError(
|
65
|
+
self, f"Id {timer.id} was found multiple times in 'timers'."
|
66
|
+
)
|
65
67
|
ids.append(timer.id)
|
66
68
|
|
67
69
|
return self
|
68
70
|
|
69
71
|
@model_validator(mode="after")
|
70
72
|
def validate_operation_modes_in_transitions(self) -> Self:
|
71
|
-
operation_mode_by_id = {
|
73
|
+
operation_mode_by_id = {
|
74
|
+
operation_mode.id: operation_mode for operation_mode in self.operation_modes
|
75
|
+
}
|
72
76
|
transition: Transition
|
73
77
|
for transition in self.transitions:
|
74
78
|
if transition.from_ not in operation_mode_by_id:
|
@@ -111,7 +115,9 @@ class FRBCActuatorDescription(GenFRBCActuatorDescription, S2MessageComponent["FR
|
|
111
115
|
power_ranges_for_commodity = [
|
112
116
|
power_range
|
113
117
|
for power_range in operation_mode_element.power_ranges
|
114
|
-
if commodity_has_quantity(
|
118
|
+
if commodity_has_quantity(
|
119
|
+
commodity, power_range.commodity_quantity
|
120
|
+
)
|
115
121
|
]
|
116
122
|
|
117
123
|
if len(power_ranges_for_commodity) > 1:
|
@@ -9,15 +9,15 @@ from s2python.validate_values_mixin import (
|
|
9
9
|
|
10
10
|
|
11
11
|
@catch_and_convert_exceptions
|
12
|
-
class FRBCActuatorStatus(GenFRBCActuatorStatus, S2MessageComponent
|
12
|
+
class FRBCActuatorStatus(GenFRBCActuatorStatus, S2MessageComponent):
|
13
13
|
model_config = GenFRBCActuatorStatus.model_config
|
14
14
|
model_config["validate_assignment"] = True
|
15
15
|
|
16
|
-
active_operation_mode_id: uuid.UUID = GenFRBCActuatorStatus.model_fields[
|
16
|
+
active_operation_mode_id: uuid.UUID = GenFRBCActuatorStatus.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
17
17
|
"active_operation_mode_id"
|
18
18
|
] # type: ignore[assignment]
|
19
|
-
actuator_id: uuid.UUID = GenFRBCActuatorStatus.model_fields["actuator_id"] # type: ignore[assignment]
|
20
|
-
message_id: uuid.UUID = GenFRBCActuatorStatus.model_fields["message_id"] # type: ignore[assignment]
|
21
|
-
previous_operation_mode_id: Optional[uuid.UUID] = GenFRBCActuatorStatus.model_fields[
|
19
|
+
actuator_id: uuid.UUID = GenFRBCActuatorStatus.model_fields["actuator_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
20
|
+
message_id: uuid.UUID = GenFRBCActuatorStatus.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
21
|
+
previous_operation_mode_id: Optional[uuid.UUID] = GenFRBCActuatorStatus.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
22
22
|
"previous_operation_mode_id"
|
23
23
|
] # type: ignore[assignment]
|
@@ -14,11 +14,11 @@ from s2python.validate_values_mixin import (
|
|
14
14
|
|
15
15
|
|
16
16
|
@catch_and_convert_exceptions
|
17
|
-
class FRBCFillLevelTargetProfile(GenFRBCFillLevelTargetProfile, S2MessageComponent
|
17
|
+
class FRBCFillLevelTargetProfile(GenFRBCFillLevelTargetProfile, S2MessageComponent):
|
18
18
|
model_config = GenFRBCFillLevelTargetProfile.model_config
|
19
19
|
model_config["validate_assignment"] = True
|
20
20
|
|
21
|
-
elements: List[FRBCFillLevelTargetProfileElement] = GenFRBCFillLevelTargetProfile.model_fields[
|
21
|
+
elements: List[FRBCFillLevelTargetProfileElement] = GenFRBCFillLevelTargetProfile.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
22
22
|
"elements"
|
23
23
|
] # type: ignore[assignment]
|
24
|
-
message_id: uuid.UUID = GenFRBCFillLevelTargetProfile.model_fields["message_id"] # type: ignore[assignment]
|
24
|
+
message_id: uuid.UUID = GenFRBCFillLevelTargetProfile.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -8,18 +8,19 @@ from s2python.common import Duration, NumberRange
|
|
8
8
|
from s2python.generated.gen_s2 import (
|
9
9
|
FRBCFillLevelTargetProfileElement as GenFRBCFillLevelTargetProfileElement,
|
10
10
|
)
|
11
|
-
from s2python.validate_values_mixin import
|
11
|
+
from s2python.validate_values_mixin import (
|
12
|
+
catch_and_convert_exceptions,
|
13
|
+
S2MessageComponent,
|
14
|
+
)
|
12
15
|
|
13
16
|
|
14
17
|
@catch_and_convert_exceptions
|
15
|
-
class FRBCFillLevelTargetProfileElement(
|
16
|
-
GenFRBCFillLevelTargetProfileElement, S2MessageComponent["FRBCFillLevelTargetProfileElement"]
|
17
|
-
):
|
18
|
+
class FRBCFillLevelTargetProfileElement(GenFRBCFillLevelTargetProfileElement, S2MessageComponent):
|
18
19
|
model_config = GenFRBCFillLevelTargetProfileElement.model_config
|
19
20
|
model_config["validate_assignment"] = True
|
20
21
|
|
21
|
-
duration: Duration = GenFRBCFillLevelTargetProfileElement.model_fields["duration"] # type: ignore[assignment]
|
22
|
-
fill_level_range: NumberRange = GenFRBCFillLevelTargetProfileElement.model_fields[
|
22
|
+
duration: Duration = GenFRBCFillLevelTargetProfileElement.model_fields["duration"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
23
|
+
fill_level_range: NumberRange = GenFRBCFillLevelTargetProfileElement.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
23
24
|
"fill_level_range"
|
24
25
|
] # type: ignore[assignment]
|
25
26
|
|
@@ -8,11 +8,11 @@ from s2python.validate_values_mixin import (
|
|
8
8
|
|
9
9
|
|
10
10
|
@catch_and_convert_exceptions
|
11
|
-
class FRBCInstruction(GenFRBCInstruction, S2MessageComponent
|
11
|
+
class FRBCInstruction(GenFRBCInstruction, S2MessageComponent):
|
12
12
|
model_config = GenFRBCInstruction.model_config
|
13
13
|
model_config["validate_assignment"] = True
|
14
14
|
|
15
|
-
actuator_id: uuid.UUID = GenFRBCInstruction.model_fields["actuator_id"] # type: ignore[assignment]
|
16
|
-
id: uuid.UUID = GenFRBCInstruction.model_fields["id"] # type: ignore[assignment]
|
17
|
-
message_id: uuid.UUID = GenFRBCInstruction.model_fields["message_id"] # type: ignore[assignment]
|
18
|
-
operation_mode: uuid.UUID = GenFRBCInstruction.model_fields["operation_mode"] # type: ignore[assignment]
|
15
|
+
actuator_id: uuid.UUID = GenFRBCInstruction.model_fields["actuator_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
16
|
+
id: uuid.UUID = GenFRBCInstruction.model_fields["id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
17
|
+
message_id: uuid.UUID = GenFRBCInstruction.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
18
|
+
operation_mode: uuid.UUID = GenFRBCInstruction.model_fields["operation_mode"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -10,11 +10,11 @@ from s2python.validate_values_mixin import (
|
|
10
10
|
|
11
11
|
|
12
12
|
@catch_and_convert_exceptions
|
13
|
-
class FRBCLeakageBehaviour(GenFRBCLeakageBehaviour, S2MessageComponent
|
13
|
+
class FRBCLeakageBehaviour(GenFRBCLeakageBehaviour, S2MessageComponent):
|
14
14
|
model_config = GenFRBCLeakageBehaviour.model_config
|
15
15
|
model_config["validate_assignment"] = True
|
16
16
|
|
17
|
-
elements: List[FRBCLeakageBehaviourElement] = GenFRBCLeakageBehaviour.model_fields[
|
17
|
+
elements: List[FRBCLeakageBehaviourElement] = GenFRBCLeakageBehaviour.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
18
18
|
"elements"
|
19
19
|
] # type: ignore[assignment]
|
20
|
-
message_id: uuid.UUID = GenFRBCLeakageBehaviour.model_fields["message_id"] # type: ignore[assignment]
|
20
|
+
message_id: uuid.UUID = GenFRBCLeakageBehaviour.model_fields["message_id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
@@ -4,18 +4,21 @@ from pydantic import model_validator
|
|
4
4
|
from typing_extensions import Self
|
5
5
|
|
6
6
|
from s2python.common import NumberRange
|
7
|
-
from s2python.generated.gen_s2 import
|
8
|
-
|
7
|
+
from s2python.generated.gen_s2 import (
|
8
|
+
FRBCLeakageBehaviourElement as GenFRBCLeakageBehaviourElement,
|
9
|
+
)
|
10
|
+
from s2python.validate_values_mixin import (
|
11
|
+
catch_and_convert_exceptions,
|
12
|
+
S2MessageComponent,
|
13
|
+
)
|
9
14
|
|
10
15
|
|
11
16
|
@catch_and_convert_exceptions
|
12
|
-
class FRBCLeakageBehaviourElement(
|
13
|
-
GenFRBCLeakageBehaviourElement, S2MessageComponent["FRBCLeakageBehaviourElement"]
|
14
|
-
):
|
17
|
+
class FRBCLeakageBehaviourElement(GenFRBCLeakageBehaviourElement, S2MessageComponent):
|
15
18
|
model_config = GenFRBCLeakageBehaviourElement.model_config
|
16
19
|
model_config["validate_assignment"] = True
|
17
20
|
|
18
|
-
fill_level_range: NumberRange = GenFRBCLeakageBehaviourElement.model_fields[
|
21
|
+
fill_level_range: NumberRange = GenFRBCLeakageBehaviourElement.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
19
22
|
"fill_level_range"
|
20
23
|
] # type: ignore[assignment]
|
21
24
|
|
@@ -16,24 +16,31 @@ from s2python.utils import pairwise
|
|
16
16
|
|
17
17
|
|
18
18
|
@catch_and_convert_exceptions
|
19
|
-
class FRBCOperationMode(GenFRBCOperationMode, S2MessageComponent
|
19
|
+
class FRBCOperationMode(GenFRBCOperationMode, S2MessageComponent):
|
20
20
|
model_config = GenFRBCOperationMode.model_config
|
21
21
|
model_config["validate_assignment"] = True
|
22
22
|
|
23
|
-
id: uuid.UUID = GenFRBCOperationMode.model_fields["id"] # type: ignore[assignment]
|
24
|
-
elements: List[FRBCOperationModeElement] = GenFRBCOperationMode.model_fields["elements"] # type: ignore[assignment]
|
23
|
+
id: uuid.UUID = GenFRBCOperationMode.model_fields["id"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
24
|
+
elements: List[FRBCOperationModeElement] = GenFRBCOperationMode.model_fields["elements"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
25
25
|
|
26
26
|
@model_validator(mode="after")
|
27
27
|
def validate_contiguous_fill_levels_operation_mode_elements(self) -> Self:
|
28
28
|
elements_by_fill_level_range: Dict[NumberRange, FRBCOperationModeElement]
|
29
|
-
elements_by_fill_level_range = {
|
29
|
+
elements_by_fill_level_range = {
|
30
|
+
element.fill_level_range: element for element in self.elements
|
31
|
+
}
|
30
32
|
|
31
33
|
sorted_fill_level_ranges: List[NumberRange]
|
32
34
|
sorted_fill_level_ranges = list(elements_by_fill_level_range.keys())
|
33
35
|
sorted_fill_level_ranges.sort(key=lambda r: r.start_of_range)
|
34
36
|
|
35
|
-
for current_fill_level_range, next_fill_level_range in pairwise(
|
36
|
-
|
37
|
+
for current_fill_level_range, next_fill_level_range in pairwise(
|
38
|
+
sorted_fill_level_ranges
|
39
|
+
):
|
40
|
+
if (
|
41
|
+
current_fill_level_range.end_of_range
|
42
|
+
!= next_fill_level_range.start_of_range
|
43
|
+
):
|
37
44
|
raise ValueError(
|
38
45
|
self,
|
39
46
|
f"Elements with fill level ranges {current_fill_level_range} and "
|
@@ -11,17 +11,17 @@ from s2python.validate_values_mixin import (
|
|
11
11
|
|
12
12
|
|
13
13
|
@catch_and_convert_exceptions
|
14
|
-
class FRBCOperationModeElement(GenFRBCOperationModeElement, S2MessageComponent
|
14
|
+
class FRBCOperationModeElement(GenFRBCOperationModeElement, S2MessageComponent):
|
15
15
|
model_config = GenFRBCOperationModeElement.model_config
|
16
16
|
model_config["validate_assignment"] = True
|
17
17
|
|
18
|
-
fill_level_range: NumberRange = GenFRBCOperationModeElement.model_fields[
|
18
|
+
fill_level_range: NumberRange = GenFRBCOperationModeElement.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
19
19
|
"fill_level_range"
|
20
20
|
] # type: ignore[assignment]
|
21
|
-
fill_rate: NumberRange = GenFRBCOperationModeElement.model_fields["fill_rate"] # type: ignore[assignment]
|
22
|
-
power_ranges: List[PowerRange] = GenFRBCOperationModeElement.model_fields[
|
21
|
+
fill_rate: NumberRange = GenFRBCOperationModeElement.model_fields["fill_rate"] # type: ignore[assignment,reportIncompatibleVariableOverride]
|
22
|
+
power_ranges: List[PowerRange] = GenFRBCOperationModeElement.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
23
23
|
"power_ranges"
|
24
24
|
] # type: ignore[assignment]
|
25
|
-
running_costs: Optional[NumberRange] = GenFRBCOperationModeElement.model_fields[
|
25
|
+
running_costs: Optional[NumberRange] = GenFRBCOperationModeElement.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
26
26
|
"running_costs"
|
27
27
|
] # type: ignore[assignment]
|
@@ -9,10 +9,10 @@ from s2python.validate_values_mixin import (
|
|
9
9
|
|
10
10
|
|
11
11
|
@catch_and_convert_exceptions
|
12
|
-
class FRBCStorageDescription(GenFRBCStorageDescription, S2MessageComponent
|
12
|
+
class FRBCStorageDescription(GenFRBCStorageDescription, S2MessageComponent):
|
13
13
|
model_config = GenFRBCStorageDescription.model_config
|
14
14
|
model_config["validate_assignment"] = True
|
15
15
|
|
16
|
-
fill_level_range: NumberRange = GenFRBCStorageDescription.model_fields[
|
16
|
+
fill_level_range: NumberRange = GenFRBCStorageDescription.model_fields[ # type: ignore[reportIncompatibleVariableOverride]
|
17
17
|
"fill_level_range"
|
18
18
|
] # type: ignore[assignment]
|