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

Feature/gsye 682 #503

Merged
merged 9 commits into from
Feb 22, 2024
1 change: 1 addition & 0 deletions gsy_framework/constants_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class BalancingSettings:
class SCMSettings:
"""Default settings for the community manager."""
GRID_FEES_REDUCTION = 0.28
INTRACOMMUNITY_BASE_RATE_EUR = None
MARKET_ALGORITHM = CoefficientAlgorithm.STATIC.value
MARKET_ALGORITHM_LIMIT = RangeLimit(1, 3)

Expand Down
1 change: 1 addition & 0 deletions gsy_framework/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CoefficientAlgorithm(Enum):
STATIC = 1
DYNAMIC = 2
NO_COMMUNITY_SELF_CONSUMPTION = 3
LIVE_STREAM = 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be implemented in the frame of GSYE-672, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. This is just a placeholder for the following ticket



class CloudCoverage(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
{"name": "settlement_market_enabled", "type": "boolean"},
{"name": "relative_std_from_forecast_percent", "type": "float"},
{"name": "bid_offer_match_algo", "type": "int"},
{"name": "scm_coefficient_algorithm", "type": "int"},
{"name": "type", "type": ["null","int"], "default": "undefined"}
{"name": "type", "type": ["null","int"], "default": "undefined"},
{"name": "scm_coefficient_algorithm", "type": ["null", "int"], "default": "null"},
{"name": "scm", "type": [
"null",
{"type": "map", "values" : ["float", "int", "string", "null"], "default": {}}
]}
]
}
6 changes: 5 additions & 1 deletion gsy_framework/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,12 @@ class ApiClientConfigSchema:
"type": "string",
"enum": ["constant", "dynamic"]
},
"group_settings": {
"type": "string",
"enum": ["constant", "dynamic"]
},
},
"required": ["start_date", "end_date", "slot_length", "currency", "coefficient_type"]
"required": ["start_date", "end_date", "slot_length", "currency"]
},
"grid": {"type": ["object"]}
}
Expand Down
1 change: 1 addition & 0 deletions gsy_framework/sim_results/scm/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def _empty_bills_dict() -> Dict:
"sold_to_grid": 0.,
"sold_to_community": 0.,
"earned_from_grid": 0.,
"earned_from_community": 0.,
"home_balance_kWh": 0.,
"home_balance": 0.,
"base_energy_bill_excl_revenue": 0.,
Expand Down
12 changes: 10 additions & 2 deletions tests/schema/test_settings_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def setup_method(self):
"settlement_market_enabled": False,
"relative_std_from_forecast_percent": 10.0,
"bid_offer_match_algo": 1,
"scm_coefficient_algorithm": 1,
"scm": {
"name": "DEFAULT_STATIC",
"coefficient_algorithm": 2,
"grid_fees_reduction": 0.01,
"intracommunity_rate_base_eur": 0.5
},
"type": 0
}

Expand Down Expand Up @@ -62,7 +67,10 @@ def _assert_all_settings_values(settings: Dict, compare_timedeltas: bool):
assert not settings["settlement_market_enabled"]
assert settings["relative_std_from_forecast_percent"] == 10.0
assert settings["bid_offer_match_algo"] == 1
assert settings["scm_coefficient_algorithm"] == 1
assert settings["scm"]["name"] == "DEFAULT_STATIC"
assert settings["scm"]["coefficient_algorithm"] == 2
assert isclose(settings["scm"]["grid_fees_reduction"], 0.01, rel_tol=0.0000001)
assert isclose(settings["scm"]["intracommunity_rate_base_eur"], 0.5, rel_tol=0.0000001)
assert settings["type"] == 0

def test_simulation_settings_validator_works(self):
Expand Down
Loading