From 84e393dd9c3670a42ec46a2d857c86542201d0f7 Mon Sep 17 00:00:00 2001 From: spyrostz Date: Wed, 28 Feb 2024 17:12:50 +0100 Subject: [PATCH 1/2] GSYE-696: Added ScmStorage and ScmHeatPump to the launch simulation AVRO schema. --- .../launch_simulation_scenario.json | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gsy_framework/schema/avro_schemas/launch_simulation_scenario.json b/gsy_framework/schema/avro_schemas/launch_simulation_scenario.json index 934035d3..11f611b0 100644 --- a/gsy_framework/schema/avro_schemas/launch_simulation_scenario.json +++ b/gsy_framework/schema/avro_schemas/launch_simulation_scenario.json @@ -298,6 +298,52 @@ {"name": "cap_price_strategy", "type": ["null", "boolean"]} ] }, + { + "name": "ScmStorage", + "type": "record", + "fields": [ + {"name": "name", "type": "string"}, + {"name": "type", "type": "string"}, + {"name": "uuid", "type": "string"}, + {"name": "libraryUUID", "type": ["null", "string"]}, + {"name": "address", "type": ["null", "string"]}, + {"name": "geo_tag_location", "type": [ + "null", { + "type": "array", + "items": "float" + } + ]}, + {"name": "prosumption_kWh_profile", "type": ["null", "string"]}, + {"name": "prosumption_kWh_profile_uuid", "type": ["null", "string"]}, + {"name": "use_market_maker_rate", "type": ["null", "boolean"]}, + {"name": "allow_external_connection", "type": ["null", "boolean"]}, + {"name": "display_type", "type": "string"}, + {"name": "forecast_stream_id", "type": ["null", "string"]} + ] + }, + { + "name": "ScmHeatPump", + "type": "record", + "fields": [ + {"name": "name", "type": "string"}, + {"name": "type", "type": "string"}, + {"name": "uuid", "type": "string"}, + {"name": "libraryUUID", "type": ["null", "string"]}, + {"name": "address", "type": ["null", "string"]}, + {"name": "geo_tag_location", "type": [ + "null", { + "type": "array", + "items": "float" + } + ]}, + {"name": "consumption_kWh_profile", "type": ["null", "string"]}, + {"name": "consumption_kWh_profile_uuid", "type": ["null", "string"]}, + {"name": "use_market_maker_rate", "type": ["null", "boolean"]}, + {"name": "allow_external_connection", "type": ["null", "boolean"]}, + {"name": "display_type", "type": "string"}, + {"name": "forecast_stream_id", "type": ["null", "string"]} + ] + }, { "name": "SmartMeter", "type": "record", From 75c81576d86a5238db0d701822ab1e4f2115dc50 Mon Sep 17 00:00:00 2001 From: spyrostz Date: Fri, 1 Mar 2024 13:39:49 +0100 Subject: [PATCH 2/2] FE-484: Fixed error string on the profile validator, in order to indicate to the user that the profile start / end time is incorrect. --- gsy_framework/validators/profile_validator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gsy_framework/validators/profile_validator.py b/gsy_framework/validators/profile_validator.py index 63243346..4131037c 100644 --- a/gsy_framework/validators/profile_validator.py +++ b/gsy_framework/validators/profile_validator.py @@ -35,14 +35,16 @@ def _profile_end_time(self) -> DateTime: def _validate_start_end_date(self): assert self._profile_start_time <= self.start_time, ( - f"start_time is not valid {self._profile_start_time}, should be <= {self.start_time}") + f"Profile start time {self._profile_start_time} is not consistent with the simulation " + f"start time {self.start_time}.") if (self._profile_end_time - self._profile_start_time == duration(days=1) - self.slot_length): # if the profile is only one day long, it will be copied to other days and # consequently, the end_date does not have to be validated return assert self._profile_end_time >= self.end_time, ( - f"end_time is not valid {self._profile_end_time}, should be >= {self.end_time}") + f"Profile end time {self._profile_end_time} is not consistent with the simulation " + f"end time {self.end_time}.") def _validate_slot_length(self): first_time = self._profile_start_time