diff --git a/assume/markets/clearing_algorithms/nodal_pricing.py b/assume/markets/clearing_algorithms/nodal_pricing.py index e1a50074f..458b7185e 100644 --- a/assume/markets/clearing_algorithms/nodal_pricing.py +++ b/assume/markets/clearing_algorithms/nodal_pricing.py @@ -176,8 +176,8 @@ def clear( ) # return orderbook_df back to orderbook format as list of dicts - accepted_orders = orderbook_df.to_dict("records") - rejected_orders = [] + accepted_orders = orderbook_df[orderbook_df["accepted_volume"] != 0].to_dict("records") + rejected_orders = orderbook_df[orderbook_df["accepted_volume"] == 0].to_dict("records") meta = [] # calculate meta data such as total upwared and downward redispatch, total backup dispatch @@ -264,4 +264,4 @@ def process_dispatch_data( # rename columns flows.columns = ["datetime", "line", "flow"] - return flows.to_dict(orient="records") + return flows.to_dict(orient="records") diff --git a/assume/markets/clearing_algorithms/redispatch.py b/assume/markets/clearing_algorithms/redispatch.py index 79f3e42cb..75d45868b 100644 --- a/assume/markets/clearing_algorithms/redispatch.py +++ b/assume/markets/clearing_algorithms/redispatch.py @@ -214,8 +214,8 @@ def clear( logger.debug("No congestion detected") # return orderbook_df back to orderbook format as list of dicts - accepted_orders = orderbook_df.to_dict("records") - rejected_orders = [] + accepted_orders = orderbook_df[orderbook_df["accepted_volume"] != 0].to_dict("records") + rejected_orders = orderbook_df[orderbook_df["accepted_volume"] == 0].to_dict("records") meta = [] # calculate meta data such as total upwared and downward redispatch, total backup dispatch diff --git a/assume/scenario/loader_oeds.py b/assume/scenario/loader_oeds.py index 5cecd78a9..1edeca7da 100644 --- a/assume/scenario/loader_oeds.py +++ b/assume/scenario/loader_oeds.py @@ -50,7 +50,7 @@ def load_oeds( freq="h", ) sim_id = f"{scenario}_{study_case}" - logger.info(f"loading scenario {sim_id}") + logger.info(f"loading scenario {sim_id} with {nuts_config}") infra_interface = InfrastructureInterface("test", infra_uri) if not nuts_config: @@ -111,13 +111,13 @@ def load_oeds( lat, lon = infra_interface.get_lat_lon_area(area) - sum_demand = demand.sum(axis=1) + sum_demand = demand.sum(axis=1).sum() - world.add_unit_operator(f"demand{area}") + world.add_unit_operator(f"demand_{area}") world.add_unit( - f"demand{area}1", + f"demand_{area}1", "demand", - f"demand{area}", + f"demand_{area}", # the unit_params have no hints { "min_power": 0, @@ -215,11 +215,12 @@ def load_oeds( "postgresql://readonly:readonly@timescale.nowum.fh-aachen.de:5432/opendata", ) - nuts_config = os.getenv("NUTS_CONFIG").split(",") - nuts_config = nuts_config or ["DE1", "DEA", "DEB", "DEC", "DED", "DEE", "DEF"] + default_nuts_config = 'DE1, DEA, DEB, DEC, DED, DEE, DEF' + nuts_config = os.getenv("NUTS_CONFIG", default_nuts_config).split(",") + nuts_config = [n.strip() for n in nuts_config] year = 2019 start = datetime(year, 1, 1) - end = datetime(year + 1, 1, 1) - timedelta(hours=1) + end = datetime(year, 1+1, 1) - timedelta(hours=1) marketdesign = [ MarketConfig( "EOM", diff --git a/examples/inputs/example_01d/lines.csv b/examples/inputs/example_01d/lines.csv index 797f01975..3f7d59598 100644 --- a/examples/inputs/example_01d/lines.csv +++ b/examples/inputs/example_01d/lines.csv @@ -1,4 +1,4 @@ -name,bus0,bus1,s_nom,x,r +Line,bus0,bus1,s_nom,x,r Line_N_S_1,north_1,south,5000.0,0.01,0.001 Line_N_S_2,north_2,south,5000.0,0.01,0.001 Line_N_N,north_1,north_2,5000.0,0.01,0.001