diff --git a/assume/markets/clearing_algorithms_extended.py b/assume/markets/clearing_algorithms_extended.py index 5e2df479..e5c84de5 100644 --- a/assume/markets/clearing_algorithms_extended.py +++ b/assume/markets/clearing_algorithms_extended.py @@ -197,7 +197,7 @@ def handle_data_response(self, content: dict, meta: MetaDict) -> None: Args: content (dict): message content with data property meta (MetaDict): message meta - """ + """ if meta["in_reply_to"] not in self.futures: logger.error(f'data response {meta["in_reply_to"]} not in awaited futures') else: @@ -215,7 +215,7 @@ def validate_registration(self, content: dict, meta: MetaDict) -> bool: Returns: bool: True if agent fulfills requirements - """ + """ if self.limitation: if self.limitation == "only_co2emissionless": requirement = lambda x: x in [ @@ -438,7 +438,7 @@ async def execute_contract(self, contract: Order): }, # TODO other market might not always be the same agent receiver_addr=self.context.addr, - receiver_id=self.context.aid, + receiver_id=self.context.aid, acl_metadata={ "sender_addr": self.context.addr, "sender_id": self.context.aid, @@ -597,9 +597,9 @@ def cfd( # TODO does not work with multiple markets with differing time scales.. # this only works for whole trading hours (as x MW*1h == x MWh) - #price_series = (contract["price"] - market_index[start:end]) * gen_series[seller][ + # price_series = (contract["price"] - market_index[start:end]) * gen_series[seller][ # start:end - #] + # ] price_series = (market_index[start:end] - contract["price"]) * gen_series[start:end] price_series = price_series.dropna() price = sum(price_series) diff --git a/assume/scenario/loader_amiris.py b/assume/scenario/loader_amiris.py index c71fb486..74e7423e 100644 --- a/assume/scenario/loader_amiris.py +++ b/assume/scenario/loader_amiris.py @@ -377,7 +377,7 @@ async def load_amiris_async( scenario (str): the scenario name study_case (str): study case to define base_path (str): base path from where to load the amrisi scenario - """ + """ amiris_scenario = read_amiris_yaml(base_path) # DeliveryIntervalInSteps = 3600 # In practice - this seems to be a fixed number in AMIRIS diff --git a/assume/strategies/extended.py b/assume/strategies/extended.py index 2aa1fd6e..7d1958b8 100644 --- a/assume/strategies/extended.py +++ b/assume/strategies/extended.py @@ -80,7 +80,9 @@ class SupportStrategy(NaiveStrategy): Strategy for OTC (over the counter trading) markets """ - def __init__(self, contract_types: list[str] = [], contract_fraction=1, *args, **kwargs): + def __init__( + self, contract_types: list[str] = [], contract_fraction=1, *args, **kwargs + ): """ Init function of the support strategy. Pass a list of contract_types for which this strategy creates individual bids each. @@ -117,9 +119,7 @@ def calculate_bids( bids = [] # demand is the other way around - power = ( - unit.min_power if type(unit).__name__ == "Demand" else unit.max_power - ) + power = unit.min_power if type(unit).__name__ == "Demand" else unit.max_power # bid 40% as support for showcase reasons power *= self.contract_fraction # require only 40 €/MWh diff --git a/examples/world_script_policy.py b/examples/world_script_policy.py index c940ca7f..bd4fee7d 100644 --- a/examples/world_script_policy.py +++ b/examples/world_script_policy.py @@ -107,7 +107,10 @@ async def init(): "min_power": 0, "max_power": 1000, "bidding_strategies": {"energy": "support", "financial_support": "support"}, - "bidding_params": {"contract_fraction": 1.0, "contract_types": ["CFD"]}, # Feed-In-Tariff + "bidding_params": { + "contract_fraction": 1.0, + "contract_types": ["CFD"], + }, # Feed-In-Tariff "technology": "demand", }, NaiveForecast(index, demand=1000), @@ -122,7 +125,10 @@ async def init(): "min_power": 200, "max_power": 1000, "bidding_strategies": {"energy": "support", "financial_support": "support"}, - "bidding_params": {"contract_fraction": 1, "contract_types": ["CFD"]}, # Feed-In-Tariff + "bidding_params": { + "contract_fraction": 1, + "contract_types": ["CFD"], + }, # Feed-In-Tariff "technology": "nuclear", }, nuclear_forecast,