Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Jan 19, 2024
1 parent 5f71f96 commit ce7a20f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
10 changes: 5 additions & 5 deletions assume/markets/clearing_algorithms_extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 [
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion assume/scenario/loader_amiris.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions assume/strategies/extended.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions examples/world_script_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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,
Expand Down

0 comments on commit ce7a20f

Please sign in to comment.