Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to prod 2024 03 01 #509

Merged
merged 5 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions gsy_framework/schema/avro_schemas/launch_simulation_scenario.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions gsy_framework/validators/profile_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading