diff --git a/assume/common/forecasts.py b/assume/common/forecasts.py index b81666aae..6ae1d7878 100644 --- a/assume/common/forecasts.py +++ b/assume/common/forecasts.py @@ -552,6 +552,13 @@ def __init__( index=self.index, value=price_forecast, name="price_forecast" ) + self.data_dict = {} + + for key, value in kwargs.items(): + self.data_dict[key] = FastSeries(index=self.index, value=value, name=key) + + + def __getitem__(self, column: str) -> FastSeries: """ Retrieves forecasted values. @@ -579,5 +586,7 @@ def __getitem__(self, column: str) -> FastSeries: return self.demand elif column == "price_EOM": return self.price_forecast + elif column in self.data_dict.keys(): + return self.data_dict[column] else: return FastSeries(value=0.0, index=self.index) diff --git a/assume/common/grid_utils.py b/assume/common/grid_utils.py index c54f58483..3ee6c5016 100644 --- a/assume/common/grid_utils.py +++ b/assume/common/grid_utils.py @@ -38,9 +38,9 @@ def add_generators( if "marginal_cost" not in gen_c.columns: gen_c["marginal_cost"] = p_set - network.madd( + network.add( "Generator", - names=generators.index, + name=generators.index, bus=generators["node"], # bus to which the generator is connected to p_nom=generators[ "max_power" @@ -49,9 +49,10 @@ def add_generators( ) else: # add generators - network.madd( + generators.drop(["p_min_pu", "p_max_pu", "marginal_cost"], axis=1, inplace=True, errors="ignore") + network.add( "Generator", - names=generators.index, + name=generators.index, bus=generators["node"], # bus to which the generator is connected to p_nom=generators[ "max_power" @@ -84,18 +85,18 @@ def add_redispatch_generators( ) # add generators and their sold capacities as load with reversed sign to have fixed feed in - network.madd( + network.add( "Load", - names=generators.index, + name=generators.index, bus=generators["node"], # bus to which the generator is connected to p_set=p_set, sign=1, ) # add upward redispatch generators - network.madd( + network.add( "Generator", - names=generators.index, + name=generators.index, suffix="_up", bus=generators["node"], # bus to which the generator is connected to p_nom=generators["max_power"], # Nominal capacity of the powerplant/generator @@ -105,9 +106,9 @@ def add_redispatch_generators( ) # add downward redispatch generators - network.madd( + network.add( "Generator", - names=generators.index, + name=generators.index, suffix="_down", bus=generators["node"], # bus to which the generator is connected to p_nom=generators["max_power"], # Nominal capacity of the powerplant/generator @@ -118,18 +119,18 @@ def add_redispatch_generators( ) # add upward and downward backup generators at each node - network.madd( + network.add( "Generator", - names=network.buses.index, + name=network.buses.index, suffix="_backup_up", bus=network.buses.index, # bus to which the generator is connected to p_nom=10e4, marginal_cost=backup_marginal_cost, ) - network.madd( + network.add( "Generator", - names=network.buses.index, + name=network.buses.index, suffix="_backup_down", bus=network.buses.index, # bus to which the generator is connected to p_nom=10e4, @@ -151,9 +152,9 @@ def add_backup_generators( """ # add backup generators at each node - network.madd( + network.add( "Generator", - names=network.buses.index, + name=network.buses.index, suffix="_backup", bus=network.buses.index, # bus to which the generator is connected to p_nom=10e4, @@ -174,9 +175,9 @@ def add_loads( """ # add loads - network.madd( + network.add( "Load", - names=loads.index, + name=loads.index, bus=loads["node"], # bus to which the generator is connected to **loads, ) @@ -201,9 +202,9 @@ def add_redispatch_loads( del loads_c["sign"] # add loads with opposite sign (default for loads is -1). This is needed to properly model the redispatch - network.madd( + network.add( "Load", - names=loads.index, + name=loads.index, bus=loads["node"], # bus to which the generator is connected to sign=1, **loads_c, @@ -237,9 +238,9 @@ def add_nodal_loads( del loads_c["sign"] # add loads as negative generators - network.madd( + network.add( "Generator", - names=loads.index, + name=loads.index, bus=loads["node"], # bus to which the generator is connected to p_nom=loads["max_power"], # Nominal capacity of the powerplant/generator p_min_pu=p_set, @@ -264,10 +265,10 @@ def read_pypsa_grid( """ def add_buses(network: pypsa.Network, buses: pd.DataFrame) -> None: - network.import_components_from_dataframe(buses, "Bus") + network.add("Bus", buses.index, **buses) def add_lines(network: pypsa.Network, lines: pd.DataFrame) -> None: - network.import_components_from_dataframe(lines, "Line") + network.add("Line", lines.index, **lines) # setup the network add_buses(network, grid_dict["buses"]) diff --git a/assume/common/outputs.py b/assume/common/outputs.py index 0dc4310dd..8e683b98e 100644 --- a/assume/common/outputs.py +++ b/assume/common/outputs.py @@ -415,14 +415,14 @@ def convert_flows(self, data: dict[tuple[datetime, str], float]): data, orient="index", columns=["flow"] ).reset_index() # Split the 'index' column into 'timestamp' and 'line' - df[["timestamp", "line"]] = pd.DataFrame( + df[["datetime", "line"]] = pd.DataFrame( df["index"].tolist(), index=df.index ) # Rename the columns df = df.drop(columns=["index"]) # set timestamp to index - df.set_index("timestamp", inplace=True) + df.set_index("datetime", inplace=True) df["simulation"] = self.simulation_id @@ -480,7 +480,6 @@ async def store_dfs(self): if df is None: continue - df.reset_index() if df.empty: continue diff --git a/assume/markets/clearing_algorithms/__init__.py b/assume/markets/clearing_algorithms/__init__.py index 5e843c38d..174fde10a 100644 --- a/assume/markets/clearing_algorithms/__init__.py +++ b/assume/markets/clearing_algorithms/__init__.py @@ -20,11 +20,8 @@ # try importing pypsa if it is installed try: - from .nodal_pricing import NodalMarketRole from .redispatch import RedispatchMarketRole clearing_mechanisms["redispatch"] = RedispatchMarketRole - clearing_mechanisms["nodal"] = NodalMarketRole - except ImportError: pass diff --git a/assume/markets/clearing_algorithms/nodal_pricing.py b/assume/markets/clearing_algorithms/nodal_pricing.py deleted file mode 100644 index ad6cac513..000000000 --- a/assume/markets/clearing_algorithms/nodal_pricing.py +++ /dev/null @@ -1,267 +0,0 @@ -# SPDX-FileCopyrightText: ASSUME Developers -# -# SPDX-License-Identifier: AGPL-3.0-or-later - -import logging - -import numpy as np -import pandas as pd -import pypsa - -from assume.common.grid_utils import ( - add_backup_generators, - add_generators, - add_nodal_loads, - calculate_network_meta, - read_pypsa_grid, -) -from assume.common.market_objects import MarketConfig, Orderbook -from assume.common.utils import suppress_output -from assume.markets.base_market import MarketRole - -logger = logging.getLogger(__name__) - -logging.getLogger("linopy").setLevel(logging.WARNING) -logging.getLogger("pypsa").setLevel(logging.WARNING) - - -class NodalMarketRole(MarketRole): - """ - - A market role that performs market clearing at each node (bus) in an electricity network. - It uses PyPSA to model the electricity network and perform market clearing. - - Args: - marketconfig (MarketConfig): The market configuration. - - Notes: - Users can also configure the path to the network data, the solver to be used, - and the backup marginal cost in the param_dict of the market configuration. - - """ - - required_fields = ["node", "max_power", "min_power"] - - def __init__(self, marketconfig: MarketConfig): - super().__init__(marketconfig) - - self.network = pypsa.Network() - # set snapshots as list from the value marketconfig.producs.count converted to list - self.network.snapshots = range(marketconfig.market_products[0].count) - - if not self.grid_data: - logger.error(f"Market '{marketconfig.market_id}': grid_data is missing.") - raise ValueError("grid_data is missing.") - - read_pypsa_grid( - network=self.network, - grid_dict=self.grid_data, - ) - add_generators( - network=self.network, - generators=self.grid_data["generators"], - ) - add_backup_generators( - network=self.network, - backup_marginal_cost=marketconfig.param_dict.get( - "backup_marginal_cost", 10e4 - ), - ) - add_nodal_loads( - network=self.network, - loads=self.grid_data["loads"], - ) - - self.solver = marketconfig.param_dict.get("solver", "highs") - if self.solver == "gurobi": - self.solver_options = {"LogToConsole": 0, "OutputFlag": 0} - elif self.solver == "appsi_highs": - self.solver_options = {"output_flag": False, "log_to_console": False} - else: - self.solver_options = {} - - # set the market clearing principle - # as pay as bid or pay as clear - self.payment_mechanism = marketconfig.param_dict.get( - "payment_mechanism", "pay_as_bid" - ) - - if self.payment_mechanism not in ["pay_as_bid", "pay_as_clear"]: - logger.error( - f"Market '{marketconfig.market_id}': Invalid payment mechanism '{self.payment_mechanism}'." - ) - raise ValueError("Invalid payment mechanism.") - - def setup(self): - super().setup() - - def clear( - self, orderbook: Orderbook, market_products - ) -> tuple[Orderbook, Orderbook, list[dict], dict[tuple, float]]: - """ - Clears the market by running a linear optimal power flow (LOPF) with PyPSA. - - Args: - orderbook (Orderbook): The orderbook to be cleared. - market_products (list[MarketProduct]): The products for which clearing happens. - - Returns: - Tuple[Orderbook, Orderbook, List[dict]]: The accepted orderbook, rejected orderbook and market metadata. - """ - - if len(orderbook) <= 0: - return super().clear(orderbook, market_products) - orderbook_df = pd.DataFrame(orderbook) - orderbook_df["accepted_volume"] = 0.0 - orderbook_df["accepted_price"] = 0.0 - - # Now you can pivot the DataFrame - volume_pivot = orderbook_df.pivot( - index="start_time", columns="unit_id", values="volume" - ) - max_power_pivot = orderbook_df.pivot( - index="start_time", columns="unit_id", values="max_power" - ) - min_power_pivot = orderbook_df.pivot( - index="start_time", columns="unit_id", values="min_power" - ) - costs = orderbook_df.pivot( - index="start_time", columns="unit_id", values="price" - ) - # change costs to negative where volume is negative - costs = costs.where(volume_pivot > 0, -costs) - - # Calculate p_max_pu_up as difference between max_power and accepted volume - p_max_pu = volume_pivot.div(max_power_pivot.where(max_power_pivot != 0, np.inf)) - - # Calculate p_max_pu_down as difference between accepted volume and min_power - p_min_pu = min_power_pivot.div( - max_power_pivot.where(max_power_pivot != 0, np.inf) - ) - p_min_pu = p_min_pu.clip(lower=0) # Ensure no negative values - - # reset indexes for all dataframes - p_max_pu.reset_index(inplace=True, drop=True) - p_min_pu.reset_index(inplace=True, drop=True) - costs.reset_index(inplace=True, drop=True) - - # Update the network parameters - nodal_network = self.network.copy() - - # Update p_max_pu for generators - nodal_network.generators_t.p_max_pu.update(p_max_pu) - nodal_network.generators_t.p_min_pu.update(p_min_pu) - - # Update marginal costs for generators - nodal_network.generators_t.marginal_cost.update(costs) - - with suppress_output(): - status, termination_condition = nodal_network.optimize( - solver_name=self.solver, - solver_options=self.solver_options, - # do not show tqdm progress bars for large grids - # https://github.com/PyPSA/linopy/pull/375 - progress=False, - ) - - if status != "ok": - logger.error(f"Solver exited with {termination_condition}") - raise Exception("Solver in redispatch market did not converge") - - log_flows = True - - # process dispatch data - flows = self.process_dispatch_data( - network=nodal_network, orderbook_df=orderbook_df, log_flows=log_flows - ) - - # return orderbook_df back to orderbook format as list of dicts - accepted_orders = orderbook_df.to_dict("records") - rejected_orders = [] - meta = [] - - # calculate meta data such as total upwared and downward redispatch, total backup dispatch - # and total redispatch cost - for i, product in enumerate(market_products): - meta.extend( - calculate_network_meta(network=nodal_network, product=product, i=i) - ) - - return accepted_orders, rejected_orders, meta, flows - - def process_dispatch_data( - self, - network: pypsa.Network, - orderbook_df: pd.DataFrame, - log_flows: bool = False, - ): - """ - This function processes the dispatch data to calculate the dispatch volumes and prices - and update the orderbook with the accepted volumes and prices. - - Args: - orderbook_df (pd.DataFrame): The orderbook to be cleared. - """ - - # Get all generators except for _backup generators - generators_t_p = network.generators_t.p.filter(regex="^(?!.*_backup)").copy() - - # select demand units as those with negative volume in orderbook - demand_units = orderbook_df[orderbook_df["volume"] < 0]["unit_id"].unique() - - # change values to negative for demand units - generators_t_p.loc[:, demand_units] *= -1 - - # Find intersection of unit_ids in orderbook_df and columns in redispatch_volumes for direct mapping - valid_units = orderbook_df["unit_id"].unique() - - for unit in valid_units: - unit_orders = orderbook_df["unit_id"] == unit - - orderbook_df.loc[unit_orders, "accepted_volume"] += generators_t_p[ - unit - ].values - - if self.payment_mechanism == "pay_as_bid": - # set accepted price as the price bid price from the orderbook - orderbook_df.loc[unit_orders, "accepted_price"] = np.where( - orderbook_df.loc[unit_orders, "accepted_volume"] > 0, - orderbook_df.loc[unit_orders, "price"], - np.where( - orderbook_df.loc[unit_orders, "accepted_volume"] < 0, - orderbook_df.loc[unit_orders, "price"], - 0, # This sets accepted_price to 0 when accepted_volume is exactly 0 - ), - ) - - elif self.payment_mechanism == "pay_as_clear": - # set accepted price as the nodal marginal price - nodal_marginal_prices = -network.buses_t.marginal_price - unit_node = orderbook_df.loc[unit_orders, "node"].values[0] - - orderbook_df.loc[unit_orders, "accepted_price"] = np.where( - orderbook_df.loc[unit_orders, "accepted_volume"] != 0, - nodal_marginal_prices[unit_node], - 0, - ) - - # get flows from optimized pypsa network - if log_flows: - # extract flows - # write network flows here if applicable - flows = [] - - # Check if the model has the 'flows' attribute - if hasattr(network, "lines_t"): - flows = network.lines_t.p0 - - flows["datetime"] = orderbook_df["start_time"].unique() - # set datetime as index - flows = flows.set_index("datetime", drop=True) - # pivot the dataframe to have row per line column per datetime - flows = flows.stack().reset_index() - - # rename columns - flows.columns = ["datetime", "line", "flow"] - - return flows diff --git a/assume/markets/clearing_algorithms/redispatch.py b/assume/markets/clearing_algorithms/redispatch.py index 07f65ba88..3c00cb729 100644 --- a/assume/markets/clearing_algorithms/redispatch.py +++ b/assume/markets/clearing_algorithms/redispatch.py @@ -204,18 +204,18 @@ def clear( logger.error(f"Solver exited with {termination_condition}") raise Exception("Solver in redispatch market did not converge") - # process dispatch data - self.process_dispatch_data( - network=redispatch_network, orderbook_df=orderbook_df - ) - # if no congestion is detected set accepted volume and price to 0 else: logger.debug("No congestion detected") + # process dispatch data + self.process_dispatch_data( + network=redispatch_network, orderbook_df=orderbook_df + ) + # 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 @@ -225,7 +225,7 @@ def clear( calculate_network_meta(network=redispatch_network, product=product, i=i) ) - # write network flows here if applicable + # TODO write network flows here flows = [] return accepted_orders, rejected_orders, meta, flows diff --git a/assume/scenario/loader_amiris.py b/assume/scenario/loader_amiris.py index 3b4eb127f..cce19b2ae 100644 --- a/assume/scenario/loader_amiris.py +++ b/assume/scenario/loader_amiris.py @@ -254,7 +254,8 @@ def add_agent_to_world( "technology": "demand", "price": load["ValueOfLostLoad"], }, - NaiveForecast(index, demand=demand_series), + # demand_series might contain more values than index + NaiveForecast(index, demand=demand_series[:len(index)]), ) case "StorageTrader": 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/assume/scenario/loader_pypsa.py b/assume/scenario/loader_pypsa.py index 1321f6944..600b4520c 100644 --- a/assume/scenario/loader_pypsa.py +++ b/assume/scenario/loader_pypsa.py @@ -22,7 +22,7 @@ def load_pypsa( study_case: str, network: pypsa.Network, marketdesign: list[MarketConfig], - bidding_strategies: dict[str, str], + bidding_strategies: dict[str, dict[str, str]], save_frequency_hours: int = 4, ): """ @@ -92,10 +92,10 @@ def load_pypsa( { "min_power": generator.p_nom_min, "max_power": max_power, - "bidding_strategies": bidding_strategies[generator.name], + "bidding_strategies": bidding_strategies[unit_type][generator.name], "technology": "conventional", "node": generator.node, - "efficiency": generator.efficiency, + "efficiency": 1, # do not use generator.efficiency as it is respected in marginal_cost, "fuel_type": generator.carrier, "ramp_up": ramp_up, "ramp_down": ramp_down, @@ -118,19 +118,21 @@ def load_pypsa( load_t = network.loads_t["p_set"][load.name] unit_type = "demand" + kwargs = {load.name: load_t} + world.add_unit( - f"demand_{load.name}", + load.name, unit_type, "demand_operator", { "min_power": 0, "max_power": load_t.max(), - "bidding_strategies": bidding_strategies[load.name], + "bidding_strategies": bidding_strategies[unit_type][load.name], "technology": "demand", "node": load.node, "price": 1e3, }, - NaiveForecast(index, demand=load_t), + NaiveForecast(index, demand=load_t, **kwargs), ) world.add_unit_operator("storage_operator") @@ -156,7 +158,7 @@ def load_pypsa( "efficiency_discharge": storage.efficiency_dispatch, "initial_soc": storage.state_of_charge_initial, "max_soc": storage.p_nom, - "bidding_strategies": bidding_strategies[storage.name], + "bidding_strategies": bidding_strategies[unit_type][storage.name], "technology": "hydro", "emission_factor": 0, "node": storage.bus, @@ -169,9 +171,9 @@ def load_pypsa( db_uri = "postgresql://assume:assume@localhost:5432/assume" world = World(database_uri=db_uri) scenario = "world_pypsa" - study_case = "scigrid_de" + study_case = "ac_dc_meshed" # "pay_as_clear", "redispatch" or "nodal" - market_mechanism = "nodal" + market_mechanism = "pay_as_clear_complex" match study_case: case "ac_dc_meshed": @@ -184,7 +186,7 @@ def load_pypsa( logger.info(f"invalid studycase: {study_case}") network = pd.DataFrame() - study_case += market_mechanism + study_case = f"{study_case}_{market_mechanism}" start = network.snapshots[0] end = network.snapshots[-1] @@ -195,11 +197,24 @@ def load_pypsa( timedelta(hours=1), market_mechanism, [MarketProduct(timedelta(hours=1), 1, timedelta(hours=1))], - additional_fields=["node", "max_power", "min_power"], + additional_fields=["node", "max_power", "min_power", "bid_type"], maximum_bid_volume=1e9, maximum_bid_price=1e9, ) ] + if market_mechanism == "redispatch": + marketdesign.append( + MarketConfig( + "EOM", + rr.rrule(rr.HOURLY, interval=1, dtstart=start-timedelta(hours=0.5), until=end), + timedelta(hours=0.25), + "pay_as_clear", + [MarketProduct(timedelta(hours=1), 1, timedelta(hours=1.5))], + additional_fields=["node", "max_power", "min_power"], + maximum_bid_volume=1e9, + maximum_bid_price=1e9, + ) + ) default_strategies = { mc.market_id: ( "naive_redispatch" if mc.market_mechanism == "redispatch" else "naive_eom" @@ -208,7 +223,11 @@ def load_pypsa( } from collections import defaultdict - bidding_strategies = defaultdict(lambda: default_strategies) + bidding_strategies = { + "power_plant": defaultdict(lambda: default_strategies), + "demand": defaultdict(lambda: {mc.market_id: "naive_eom" for mc in marketdesign}), + "storage": defaultdict(lambda: default_strategies), + } load_pypsa(world, scenario, study_case, network, marketdesign, bidding_strategies) world.run() diff --git a/assume/units/powerplant.py b/assume/units/powerplant.py index 13b4f3468..54d5dbb95 100644 --- a/assume/units/powerplant.py +++ b/assume/units/powerplant.py @@ -273,13 +273,13 @@ def calculate_min_max_power( min_power = min_power.clip(min=heat_demand) available_power = self.forecaster.get_availability(self.id).loc[start:end_excl] + max_power = available_power * self.max_power # check if available power is larger than max_power and raise an error if so - if (available_power > self.max_power).any(): + if (max_power > self.max_power).any(): raise ValueError( f"Available power is larger than max_power for unit {self.id} at time {start}." ) - max_power = available_power * self.max_power # provide reserve for capacity_pos max_power = max_power - self.outputs["capacity_pos"].loc[start:end_excl] # remove what has already been bid diff --git a/docker_configs/dashboard-definitions/ASSUME Comparison.json b/docker_configs/dashboard-definitions/ASSUME Comparison.json index cd17df9e5..b165d5b33 100644 --- a/docker_configs/dashboard-definitions/ASSUME Comparison.json +++ b/docker_configs/dashboard-definitions/ASSUME Comparison.json @@ -26,14 +26,13 @@ "graphTooltip": 0, "id": 1, "links": [], - "liveNow": false, "panels": [ { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 6, "w": 24, @@ -50,7 +49,7 @@ "content": "# Welcome to our ASSUME Simulation Comparison Demo\n\nThis is the Grafana Dashboard helps you to compare the results of two simulation. Please note, this dashboard is still under development. Here you can visualize the differences between two simulations. So if some/most of the plots are 0 it just means that the results of your simulation are the same. \n\nYou are currently displaying the difference between:\n##### ${simulation_comp} - ${simulation}", "mode": "markdown" }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "title": "Overview Dashboard", "type": "text" }, @@ -68,9 +67,9 @@ "type": "row" }, { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" + "fieldConfig": { + "defaults": {}, + "overrides": [] }, "gridPos": { "h": 3, @@ -88,41 +87,8 @@ "content": "# Market-specific Data\n\nData specific for the market depending on the choice made at te top of the panel\n\n", "mode": "markdown" }, - "pluginVersion": "9.2.15", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n product_start AS \"time\",\n supply_volume\nFROM market_meta\nWHERE\n $__timeFilter(product_start)\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "supply_volume" - ], - "type": "column" - } - ] - ], - "table": "market_meta", - "timeColumn": "product_start", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "pluginVersion": "11.3.1", + "title": "", "type": "text" }, { @@ -136,11 +102,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -149,6 +117,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -197,16 +166,18 @@ "showLegend": true }, "tooltip": { - "mode": "single", + "mode": "multi", "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", @@ -223,6 +194,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -445,11 +433,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -458,6 +448,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -511,7 +502,7 @@ "sort": "none" } }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -621,11 +612,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -634,6 +627,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -666,32 +660,7 @@ }, "unit": "megwatt" }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "Volume pp_4_1" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 8, @@ -714,6 +683,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -835,6 +805,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -849,6 +820,9 @@ "lineWidth": 1, "scaleDistribution": { "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" } }, "mappings": [], @@ -912,6 +886,7 @@ "options": { "barRadius": 0, "barWidth": 0.97, + "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], @@ -930,7 +905,7 @@ "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -978,7 +953,9 @@ "defaults": { "custom": { "align": "auto", - "displayMode": "auto", + "cellOptions": { + "type": "auto" + }, "inspect": false }, "mappings": [], @@ -1032,7 +1009,9 @@ }, "id": 76, "options": { + "cellHeight": "sm", "footer": { + "countRows": false, "fields": "", "reducer": [ "sum" @@ -1047,7 +1026,7 @@ } ] }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1139,6 +1118,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1210,11 +1190,11 @@ "type": "row" }, { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 3, "w": 24, @@ -1231,41 +1211,8 @@ "content": "# Unit Specific Data\n\nFor the chosen market and the chosen unit here the dispatch is displayed.", "mode": "markdown" }, - "pluginVersion": "9.2.15", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"Timestamp\" AS \"time\",\n volume\nFROM demand_meta\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "volume" - ], - "type": "column" - } - ] - ], - "table": "demand_meta", - "timeColumn": "\"Timestamp\"", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "pluginVersion": "11.3.1", + "title": "", "type": "text" }, { @@ -1279,11 +1226,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -1292,6 +1241,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" @@ -1348,12 +1298,14 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, @@ -1371,6 +1323,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "demand_meta", "timeColumn": "\"Timestamp\"", "timeColumnType": "timestamp", @@ -1387,12 +1356,13 @@ "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "select sim1.\"time\", sim2.\"dispatch\" - sim1.\"dispatch\" as \"dispatch\", sim1.unit from (\nSELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Gen_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim1\nleft join (\nSELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation_comp' AND\n unit in ($Gen_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim2\non sim1.unit = sim2.unit and sim1.time=sim2.time", + "rawSql": "select sim1.\"time\", sim2.\"dispatch\" - sim1.\"dispatch\" as \"dispatch\", sim1.unit from (\nSELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(time) AND\n simulation = '$simulation' AND\n unit in ($Gen_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim1\nleft join (\nSELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(time) AND\n simulation = '$simulation_comp' AND\n unit in ($Gen_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim2\non sim1.unit = sim2.unit and sim1.time=sim2.time", "refId": "B", "select": [ [ @@ -1404,6 +1374,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "demand_meta", "timeColumn": "\"Timestamp\"", "timeColumnType": "timestamp", @@ -1450,7 +1437,9 @@ }, "id": 26, "options": { + "afterRender": "", "content": "### General Information\n\nName: {{index}}
\nTechnology: {{technology}}
\n\n### Technical Specifications\nEmissions: {{emission_factor}} t/MWh
\nMaximum Power: {{max_power}} MW
\nMinimum Power: {{min_power}} MW
\nEfficiency: {{efficiency}}
\n\n##### Unit Operator: {{unit_operator}}\n ", + "contentPartials": [], "defaultContent": "The query didn't return any results.", "editor": { "format": "auto", @@ -1458,12 +1447,14 @@ "language": "markdown" }, "editors": [], - "everyRow": true, "externalScripts": [], "externalStyles": [], "helpers": "", - "styles": "" + "renderMode": "everyRow", + "styles": "", + "wrap": true }, + "pluginVersion": "5.4.0", "targets": [ { "datasource": { @@ -1513,11 +1504,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -1526,6 +1519,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -1592,6 +1586,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1703,11 +1698,11 @@ "type": "row" }, { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 3, "w": 24, @@ -1724,41 +1719,8 @@ "content": "# Unit Specific Data\n\nFor the chosen market and the chosen unit here the dispatch is displayed.", "mode": "markdown" }, - "pluginVersion": "9.2.15", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"Timestamp\" AS \"time\",\n volume\nFROM demand_meta\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "volume" - ], - "type": "column" - } - ] - ], - "table": "demand_meta", - "timeColumn": "\"Timestamp\"", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "pluginVersion": "11.3.1", + "title": "", "type": "text" }, { @@ -1772,11 +1734,13 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -1785,6 +1749,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 5, @@ -1838,6 +1803,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1876,12 +1842,13 @@ "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "select sim1.\"time\", sim2.\"dispatch\" - sim1.\"dispatch\" as \"dispatch\", sim1.unit from (\nSELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Demand_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim1\nleft join (\nSELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation_comp' AND\n unit in ($Demand_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim2\non sim1.unit = sim2.unit and sim1.time=sim2.time", + "rawSql": "select sim1.\"time\", sim2.\"dispatch\" - sim1.\"dispatch\" as \"dispatch\", sim1.unit from (\nSELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(time) AND\n simulation = '$simulation' AND\n unit in ($Demand_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim1\nleft join (\nSELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(time) AND\n simulation = '$simulation_comp' AND\n unit in ($Demand_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim2\non sim1.unit = sim2.unit and sim1.time=sim2.time", "refId": "B", "select": [ [ @@ -1893,6 +1860,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -1939,7 +1923,9 @@ }, "id": 37, "options": { + "afterRender": "", "content": "### General Information\n\nName: {{index}}
\nTechnology: {{technology}}
\n\n### Technical Specifications\nEmissions: {{emission_factor}} t/MWh
\nMaximum Power: {{max_power}} MW
\nMinimum Power: {{min_power}} MW
\nEfficiency: {{efficiency}}
\n\n##### Unit Operator: {{unit_operator}}\n ", + "contentPartials": [], "defaultContent": "The query didn't return any results.", "editor": { "format": "auto", @@ -1947,12 +1933,14 @@ "language": "markdown" }, "editors": [], - "everyRow": true, "externalScripts": [], "externalStyles": [], "helpers": "", - "styles": "" + "renderMode": "everyRow", + "styles": "", + "wrap": true }, + "pluginVersion": "5.4.0", "targets": [ { "datasource": { @@ -2001,11 +1989,11 @@ "id": 44, "panels": [ { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 3, "w": 24, @@ -2023,40 +2011,7 @@ "mode": "markdown" }, "pluginVersion": "9.2.15", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"Timestamp\" AS \"time\",\n volume\nFROM demand_meta\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "volume" - ], - "type": "column" - } - ] - ], - "table": "demand_meta", - "timeColumn": "\"Timestamp\"", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "title": "", "type": "text" }, { @@ -2104,8 +2059,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2179,7 +2133,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "select sim1.\"time\", sim2.\"dispatch\" - sim1.\"dispatch\" as \"dispatch\", sim1.unit from (\nSELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Storage_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim1\njoin (\nSELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation_comp' AND\n unit in ($Storage_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim2\non sim1.unit = sim2.unit and sim1.time=sim2.time", + "rawSql": "select sim1.\"time\", sim2.\"dispatch\" - sim1.\"dispatch\" as \"dispatch\", sim1.unit from (\nSELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Storage_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim1\njoin (\nSELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation_comp' AND\n unit in ($Storage_Units)\nGROUP BY 1, unit, power\nORDER BY 1\n) sim2\non sim1.unit = sim2.unit and sim1.time=sim2.time", "refId": "B", "select": [ [ @@ -2217,8 +2171,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2290,22 +2243,20 @@ } ], "repeat": "Storage_Units", - "repeatDirection": "h", "title": "Storage units data $Storage_Units", "type": "row" } ], - "refresh": false, - "schemaVersion": 37, - "style": "dark", + "preload": false, + "refresh": "", + "schemaVersion": 40, "tags": [], "templating": { "list": [ { "current": { - "selected": true, - "text": "learning_scenario_1_base", - "value": "learning_scenario_1_base" + "text": "example_01a_base", + "value": "example_01a_base" }, "datasource": { "type": "postgres", @@ -2313,23 +2264,19 @@ }, "definition": "SELECT \n simulation\nFROM power_plant_meta\ngroup by simulation;", "description": "Can choose which simulation we want to show ", - "hide": 0, "includeAll": false, - "multi": false, "name": "simulation", "options": [], "query": "SELECT \n simulation\nFROM power_plant_meta\ngroup by simulation;", "refresh": 1, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": true, - "text": "learning_scenario_2_base", - "value": "learning_scenario_2_base" + "text": "example_01a_base", + "value": "example_01a_base" }, "datasource": { "type": "postgres", @@ -2337,21 +2284,17 @@ }, "definition": "SELECT \n simulation\nFROM power_plant_meta\ngroup by simulation;", "description": "Simulation to which a comparison is made", - "hide": 0, "includeAll": false, - "multi": false, "name": "simulation_comp", "options": [], "query": "SELECT \n simulation\nFROM power_plant_meta\ngroup by simulation;", "refresh": 1, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": false, "text": "EOM", "value": "EOM" }, @@ -2361,23 +2304,23 @@ }, "definition": "SELECT \n market_id\nFROM market_meta\nwhere simulation='$simulation'\ngroup by market_id ;", "description": "Choose for which market the data is displayed", - "hide": 0, "includeAll": false, - "multi": false, "name": "market", "options": [], "query": "SELECT \n market_id\nFROM market_meta\nwhere simulation='$simulation'\ngroup by market_id ;", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": false, - "text": "pp_1", - "value": "pp_1" + "text": [ + "Unit 1" + ], + "value": [ + "Unit 1" + ] }, "datasource": { "type": "postgres", @@ -2385,22 +2328,18 @@ }, "definition": "SELECT index\nFROM power_plant_meta\nwhere simulation = '$simulation';", "description": "Can choose which units we want to display ", - "hide": 0, "includeAll": false, - "label": "", "multi": true, "name": "Gen_Units", "options": [], "query": "SELECT index\nFROM power_plant_meta\nwhere simulation = '$simulation';", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": true, "text": [ "demand_EOM" ], @@ -2414,25 +2353,20 @@ }, "definition": "SELECT index\nFROM demand_meta\nwhere simulation = '$simulation';", "description": "Can choose which units we want to display ", - "hide": 0, "includeAll": false, - "label": "", "multi": true, "name": "Demand_Units", "options": [], "query": "SELECT index\nFROM demand_meta\nwhere simulation = '$simulation';", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "isNone": true, - "selected": false, - "text": "None", - "value": "" + "text": [], + "value": [] }, "datasource": { "type": "postgres", @@ -2440,16 +2374,13 @@ }, "definition": "SELECT index\nFROM storage_meta\nwhere simulation = '$simulation';", "description": "Can choose which storage units we want to display ", - "hide": 0, "includeAll": false, - "label": "", "multi": true, "name": "Storage_Units", "options": [], "query": "SELECT index\nFROM storage_meta\nwhere simulation = '$simulation';", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" } @@ -2463,6 +2394,6 @@ "timezone": "", "title": "ASSUME: Compare scenarios", "uid": "vP8U8-q4k", - "version": 2, + "version": 5, "weekStart": "" -} +} \ No newline at end of file diff --git a/docker_configs/dashboard-definitions/ASSUME.json b/docker_configs/dashboard-definitions/ASSUME.json index 2ea384f7e..a5ec97f01 100644 --- a/docker_configs/dashboard-definitions/ASSUME.json +++ b/docker_configs/dashboard-definitions/ASSUME.json @@ -26,14 +26,13 @@ "graphTooltip": 0, "id": 2, "links": [], - "liveNow": false, "panels": [ { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 4, "w": 24, @@ -50,7 +49,7 @@ "content": "# Welcome to our ASSUME demo\n\nThis is the Grafana Dashboard which makes interacting with the simulation data very easy.", "mode": "markdown" }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "title": "Overview Dashboard", "type": "text" }, @@ -68,9 +67,9 @@ "type": "row" }, { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" + "fieldConfig": { + "defaults": {}, + "overrides": [] }, "gridPos": { "h": 3, @@ -88,41 +87,8 @@ "content": "# Market-specific Data\n\nData specific for the market depending on the choice made at te top of the panel\n\n", "mode": "markdown" }, - "pluginVersion": "11.2.0", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n product_start AS \"time\",\n supply_volume\nFROM market_meta\nWHERE\n $__timeFilter(product_start)\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "supply_volume" - ], - "type": "column" - } - ] - ], - "table": "market_meta", - "timeColumn": "product_start", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "pluginVersion": "11.3.1", + "title": "", "type": "text" }, { @@ -432,6 +398,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -613,6 +580,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -835,7 +803,7 @@ "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -968,7 +936,7 @@ } ] }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1061,6 +1029,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1132,11 +1101,11 @@ "type": "row" }, { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 3, "w": 24, @@ -1153,41 +1122,8 @@ "content": "# Unit Specific Data\n\nFor the chosen market and the chosen unit here the dispatch is displayed.", "mode": "markdown" }, - "pluginVersion": "11.2.0", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"Timestamp\" AS \"time\",\n volume\nFROM demand_meta\nWHERE\n $__timeFilter(\"Timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "volume" - ], - "type": "column" - } - ] - ], - "table": "demand_meta", - "timeColumn": "\"Timestamp\"", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "pluginVersion": "11.3.1", + "title": "", "type": "text" }, { @@ -1278,6 +1214,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1286,7 +1223,7 @@ }, "format": "time_series", "group": [], - "hide": false, + "hide": true, "metricColumn": "none", "rawQuery": true, "rawSql": "SELECT\n $__timeGroupAlias(datetime,$__interval),\n avg(power) AS \"Market dispatch\",\n concat(unit_id, ' - ', market_id) as \"unit_id\"\nFROM market_dispatch\nWHERE\n $__timeFilter(datetime) AND\n simulation = '$simulation' AND\n unit_id in ($Gen_Units)\nGROUP BY 1, unit_id, power, market_id\nORDER BY 1", @@ -1317,12 +1254,13 @@ "type": "postgres", "uid": "P7B13B9DF907EC40C" }, - "format": "time_series", + "editorMode": "code", + "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n $__timeGroupAlias(index,$__interval),\n avg(power) AS \"Actual dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Gen_Units)\nGROUP BY 1, unit, power\nORDER BY 1", + "rawSql": "SELECT\n time::timestamp,\n power,\n unit\nFROM unit_dispatch\nWHERE\n --$__timeFilter(index) AND\n simulation = '$simulation'\nORDER BY 1", "refId": "B", "select": [ [ @@ -1334,6 +1272,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "demand_meta", "timeColumn": "\"Timestamp\"", "timeColumnType": "timestamp", @@ -1534,7 +1489,7 @@ "sort": "desc" } }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1780,6 +1735,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -1952,18 +1908,19 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(index) AND\r\n simulation = '$simulation' AND\r\n unit in ($Gen_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(time) AND\r\n simulation = '$simulation' AND\r\n unit in ($Gen_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -1975,6 +1932,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -2103,18 +2077,19 @@ "sort": "none" } }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(index) AND\r\n simulation = '$simulation' AND\r\n unit in ($Gen_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(time) AND\r\n simulation = '$simulation' AND\r\n unit in ($Gen_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -2126,6 +2101,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -2239,12 +2231,14 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", @@ -2261,6 +2255,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "demand_meta", "timeColumn": "\"Timestamp\"", "timeColumnType": "timestamp", @@ -2277,12 +2288,13 @@ "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"Actual dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Demand_Units)\nGROUP BY 1, unit, power\nORDER BY 1", + "rawSql": "SELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"Actual dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(time) AND\n simulation = '$simulation' AND\n unit in ($Demand_Units)\nGROUP BY 1, unit, power\nORDER BY 1", "refId": "B", "select": [ [ @@ -2294,6 +2306,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -2494,7 +2523,7 @@ "sort": "desc" } }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -2684,19 +2713,20 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n -energy_cashflow AS \"Cashflow\",\r\n unit\r\nFROM unit_dispatch d\r\nWHERE\r\n $__timeFilter(index) AND\r\n d.simulation = '$simulation' AND\r\n unit in ($Demand_Units)\r\nGROUP BY 1, unit, energy_cashflow, power\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n -energy_cashflow AS \"Cashflow\",\r\n unit\r\nFROM unit_dispatch d\r\nWHERE\r\n $__timeFilter(time) AND\r\n d.simulation = '$simulation' AND\r\n unit in ($Demand_Units)\r\nGROUP BY 1, unit, energy_cashflow, power\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -2708,6 +2738,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -2837,6 +2884,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -2944,19 +2992,20 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n sum(energy_cashflow)/sum(power) as \"Price per MW\",\n unit\nFROM unit_dispatch d\nWHERE\n $__timeFilter(index) AND\n d.simulation = '$simulation' AND\n unit in ($Demand_Units)\nGROUP BY unit\nORDER BY 1", + "rawSql": "SELECT\n sum(energy_cashflow)/sum(power) as \"Price per MW\",\n unit\nFROM unit_dispatch d\nWHERE\n $__timeFilter(time) AND\n d.simulation = '$simulation' AND\n unit in ($Demand_Units)\nGROUP BY unit\nORDER BY 1", "refId": "A", "select": [ [ @@ -2968,6 +3017,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -3035,19 +3101,20 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n -power*1e3 as \"Volume\",\r\n unit\r\nFROM unit_dispatch d\r\nWHERE\r\n $__timeFilter(index) AND\r\n d.simulation = '$simulation' AND\r\n unit in ($Demand_Units)\r\nGROUP BY 1, unit, energy_cashflow, power\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n -power*1e3 as \"Volume\",\r\n unit\r\nFROM unit_dispatch d\r\nWHERE\r\n $__timeFilter(time) AND\r\n d.simulation = '$simulation' AND\r\n unit in ($Demand_Units)\r\nGROUP BY 1, unit, energy_cashflow, power\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -3059,6 +3126,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -3176,17 +3260,19 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n -energy_cashflow AS \"Cashflow\",\r\n -energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(index) AND\r\n simulation = '$simulation' AND\r\n unit in ($Demand_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n -energy_cashflow AS \"Cashflow\",\r\n -energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(time) AND\r\n simulation = '$simulation' AND\r\n unit in ($Demand_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -3198,6 +3284,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -3311,12 +3414,14 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", @@ -3333,6 +3438,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "demand_meta", "timeColumn": "\"Timestamp\"", "timeColumnType": "timestamp", @@ -3349,12 +3471,13 @@ "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n $__timeGroupAlias(index,$__interval),\n power AS \"Actual dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(index) AND\n simulation = '$simulation' AND\n unit in ($Storage_Units)\nGROUP BY 1, unit, power\nORDER BY 1", + "rawSql": "SELECT\n $__timeGroupAlias(time,$__interval),\n power AS \"Actual dispatch\",\n unit\nFROM unit_dispatch\nWHERE\n $__timeFilter(time) AND\n simulation = '$simulation' AND\n unit in ($Storage_Units)\nGROUP BY 1, unit, power\nORDER BY 1", "refId": "B", "select": [ [ @@ -3366,6 +3489,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -3553,6 +3693,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -3564,7 +3705,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n SOC AS \"State of Charge\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(index) AND\r\n simulation = '$simulation' AND\r\n unit in ($Storage_Units)\r\nGROUP BY 1, unit, SOC\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n SOC AS \"State of Charge\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(time) AND\r\n simulation = '$simulation' AND\r\n unit in ($Storage_Units)\r\nGROUP BY 1, unit, SOC\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -3732,7 +3873,7 @@ "sort": "desc" } }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -3987,6 +4128,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -4177,18 +4319,19 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.2.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(index) AND\r\n simulation = '$simulation' AND\r\n unit in ($Storage_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(time) AND\r\n simulation = '$simulation' AND\r\n unit in ($Storage_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -4200,6 +4343,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -4328,18 +4488,19 @@ "sort": "none" } }, - "pluginVersion": "9.2.15", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n $__timeGroupAlias(index,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(index) AND\r\n simulation = '$simulation' AND\r\n unit in ($Storage_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", + "rawSql": "SELECT\r\n $__timeGroupAlias(time,$__interval),\r\n energy_cashflow AS \"Cashflow\",\r\n energy_marginal_costs AS \"Production costs\",\r\n energy_cashflow - energy_marginal_costs AS \"Profit\",\r\n unit\r\nFROM unit_dispatch\r\nWHERE\r\n $__timeFilter(time) AND\r\n simulation = '$simulation' AND\r\n unit in ($Storage_Units)\r\nGROUP BY 1, unit, energy_cashflow, energy_marginal_costs\r\nORDER BY 1", "refId": "A", "select": [ [ @@ -4351,6 +4512,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "market_dispatch", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -4367,16 +4545,16 @@ "type": "timeseries" } ], + "preload": false, "refresh": "", - "schemaVersion": 39, + "schemaVersion": 40, "tags": [], "templating": { "list": [ { "current": { - "selected": false, - "text": "example_02e_base", - "value": "example_02e_base" + "text": "example_01a_base", + "value": "example_01a_base" }, "datasource": { "type": "postgres", @@ -4384,21 +4562,17 @@ }, "definition": "SELECT simulation\nFROM market_meta", "description": "Can choose which simulation we want to show ", - "hide": 0, "includeAll": false, - "multi": false, "name": "simulation", "options": [], "query": "SELECT simulation\nFROM market_meta", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": false, "text": "EOM", "value": "EOM" }, @@ -4408,23 +4582,23 @@ }, "definition": "SELECT \n market_id\nFROM market_meta\nwhere simulation='$simulation'\ngroup by market_id ;", "description": "Choose for which market the data is displayed", - "hide": 0, "includeAll": false, - "multi": false, "name": "market", "options": [], "query": "SELECT \n market_id\nFROM market_meta\nwhere simulation='$simulation'\ngroup by market_id ;", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": false, - "text": "pp_1", - "value": "pp_1" + "text": [ + "Unit 1" + ], + "value": [ + "Unit 1" + ] }, "datasource": { "type": "postgres", @@ -4432,24 +4606,24 @@ }, "definition": "SELECT index\nFROM power_plant_meta\nwhere simulation = '$simulation';", "description": "Can choose which units we want to display ", - "hide": 0, "includeAll": false, - "label": "", "multi": true, "name": "Gen_Units", "options": [], "query": "SELECT index\nFROM power_plant_meta\nwhere simulation = '$simulation';", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": false, - "text": "demand_EOM", - "value": "demand_EOM" + "text": [ + "demand_EOM" + ], + "value": [ + "demand_EOM" + ] }, "datasource": { "type": "postgres", @@ -4457,28 +4631,20 @@ }, "definition": "SELECT index\nFROM demand_meta\nwhere simulation = '$simulation';", "description": "Can choose which units we want to display ", - "hide": 0, "includeAll": false, - "label": "", "multi": true, "name": "Demand_Units", "options": [], "query": "SELECT index\nFROM demand_meta\nwhere simulation = '$simulation';", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": true, - "text": [ - "Storage 1" - ], - "value": [ - "Storage 1" - ] + "text": [], + "value": [] }, "datasource": { "type": "postgres", @@ -4486,24 +4652,21 @@ }, "definition": "SELECT index\nFROM storage_meta\nwhere simulation = '$simulation';", "description": "Can choose which storage units we want to display ", - "hide": 0, "includeAll": false, - "label": "", "multi": true, "name": "Storage_Units", "options": [], "query": "SELECT index\nFROM storage_meta\nwhere simulation = '$simulation';", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" } ] }, "time": { - "from": "2019-03-01T00:00:00.000Z", - "to": "2019-04-30T23:59:59.000Z" + "from": "2019-01-01T02:50:49.533Z", + "to": "2019-01-03T00:53:27.762Z" }, "timepicker": { "refresh_intervals": [ @@ -4518,6 +4681,6 @@ "timezone": "utc", "title": "ASSUME: Main overview", "uid": "mQ3Lvkr4k", - "version": 4, + "version": 3, "weekStart": "" -} +} \ No newline at end of file diff --git a/docker_configs/dashboard-definitions/ASSUME_nodal.json b/docker_configs/dashboard-definitions/ASSUME_nodal.json index a9f319877..06c3589e0 100644 --- a/docker_configs/dashboard-definitions/ASSUME_nodal.json +++ b/docker_configs/dashboard-definitions/ASSUME_nodal.json @@ -24,16 +24,15 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 1, + "id": 4, "links": [], - "liveNow": false, "panels": [ { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, "description": "", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 4, "w": 24, @@ -50,81 +49,10 @@ "content": "# Nodal Analysing Board\n\nThis board can be used to visualize the Grid statistics and usage.\nAs well as the prices at different locations of the grid.", "mode": "markdown" }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.3.1", "title": "Nodal Dashboard", "type": "text" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 4 - }, - "id": 30, - "panels": [], - "title": "Market Data", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "gridPos": { - "h": 3, - "w": 24, - "x": 0, - "y": 5 - }, - "id": 17, - "options": { - "code": { - "language": "plaintext", - "showLineNumbers": false, - "showMiniMap": false - }, - "content": "# Market-specific Data\n\nData specific for the market depending on the choice made at te top of the panel\n\n", - "mode": "markdown" - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "P7B13B9DF907EC40C" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n product_start AS \"time\",\n supply_volume\nFROM market_meta\nWHERE\n $__timeFilter(product_start)\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "supply_volume" - ], - "type": "column" - } - ] - ], - "table": "market_meta", - "timeColumn": "product_start", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "type": "text" - }, { "datasource": { "type": "postgres", @@ -143,20 +71,37 @@ "color": "green", "value": null }, + { + "color": "#EAB839", + "value": 0.5 + }, { "color": "red", - "value": 80 + "value": 0.8 } ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "usage" + }, + "properties": [ + { + "id": "unit", + "value": "percentunit" + } + ] + } + ] }, "gridPos": { - "h": 8, + "h": 9, "w": 12, "x": 0, - "y": 8 + "y": 4 }, "id": 101, "options": { @@ -180,6 +125,7 @@ "clusterMinDistance": 0, "clusterValue": "size", "color": { + "field": "usage", "fixed": "dark-green" }, "enableGradient": false, @@ -199,7 +145,7 @@ "displayProperties": [ "bus0", "bus1", - "s_nom" + "usage" ], "location": { "geohash": "geometry", @@ -208,7 +154,7 @@ }, "name": "Grid Data", "query": "A", - "titleField": "bus0", + "titleField": "name", "type": "markers" } ], @@ -219,18 +165,19 @@ "zoom": 5 } }, - "pluginVersion": "9.2.15", + "pluginVersion": "1.4.4", "targets": [ { "datasource": { "type": "postgres", "uid": "P7B13B9DF907EC40C" }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n bus0, bus1, s_nom, ST_AsGeoJSON(ST_GeomFromEWKT(wkt_srid_4326)) as geometry, simulation\nFROM lines_geo\nwhere simulation = '$simulation' \nORDER BY 1", + "rawSql": "SELECT\n datetime, coalesce(abs(flow),0)/s_nom as \"usage\", l.line as name, bus0, bus1, ST_AsGeoJSON(ST_GeomFromEWKT(wkt_srid_4326)) as geometry, l.simulation\nFROM lines_geo l\nleft join grid_flows g on l.line = g.line and l.simulation = g.simulation\nWHERE\n $__timeFilter(datetime) AND\nl.simulation = '$simulation'\nORDER BY 1\n", "refId": "A", "select": [ [ @@ -242,6 +189,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "lines_geo", "timeColumn": "datetime", "timeColumnType": "timestamp", @@ -251,6 +215,243 @@ "title": "Grid Information", "type": "orchestracities-map-panel" }, + { + "datasource": { + "type": "postgres", + "uid": "P7B13B9DF907EC40C" + }, + "description": "Overview of nodal results", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kwatt" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 4 + }, + "id": 103, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.3.1", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "P7B13B9DF907EC40C" + }, + "editorMode": "code", + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "none" + ], + "type": "time" + }, + { + "params": [ + "unit_id" + ], + "type": "column" + } + ], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select $__timeGroupAlias(datetime, $__interval), line, avg(flow) as flow from grid_flows where simulation = '$simulation'\nAND $__timeFilter(datetime)\nGROUP BY 1, line\nORDER BY 1;\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "price" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "price" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "unit_id" + ], + "type": "column" + }, + { + "params": [ + "unit_id" + ], + "type": "alias" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "market_orders", + "timeColumn": "start_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "text", + "name": "", + "params": [ + "market_id", + "=", + "'$market'" + ], + "type": "expression" + }, + { + "datatype": "text", + "name": "", + "params": [ + "simulation", + "=", + "'$simulation'" + ], + "type": "expression" + } + ] + } + ], + "title": "Grid Flows Nodal", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 30, + "panels": [], + "title": "Market Data", + "type": "row" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 17, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Market-specific Data\n\nData specific for the market depending on the choice made at te top of the panel\n\n", + "mode": "markdown" + }, + "pluginVersion": "11.3.1", + "title": "", + "type": "text" + }, { "datasource": { "type": "grafana-postgresql-datasource", @@ -336,7 +537,7 @@ "h": 8, "w": 24, "x": 0, - "y": 16 + "y": 17 }, "id": 11, "maxPerRow": 4, @@ -436,6 +637,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -466,7 +668,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -482,7 +685,7 @@ "h": 9, "w": 12, "x": 0, - "y": 24 + "y": 25 }, "id": 19, "options": { @@ -499,6 +702,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -614,6 +818,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -644,7 +849,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -660,7 +866,7 @@ "h": 9, "w": 12, "x": 12, - "y": 24 + "y": 25 }, "id": 20, "options": { @@ -677,6 +883,7 @@ "sort": "desc" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -775,15 +982,15 @@ "type": "timeseries" } ], - "schemaVersion": 39, + "preload": false, + "schemaVersion": 40, "tags": [], "templating": { "list": [ { "current": { - "selected": false, - "text": "example_01d_base", - "value": "example_01d_base" + "text": "example_01d_nodal_case", + "value": "example_01d_nodal_case" }, "datasource": { "type": "postgres", @@ -791,21 +998,17 @@ }, "definition": "SELECT simulation\nFROM market_meta", "description": "Can choose which simulation we want to show ", - "hide": 0, "includeAll": false, - "multi": false, "name": "simulation", "options": [], "query": "SELECT simulation\nFROM market_meta", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { - "selected": false, "text": "DAM", "value": "DAM" }, @@ -815,25 +1018,21 @@ }, "definition": "SELECT \n market_id\nFROM market_meta\nwhere simulation='$simulation'\ngroup by market_id ;", "description": "Choose for which market the data is displayed", - "hide": 0, "includeAll": false, - "multi": false, "name": "market", "options": [], "query": "SELECT \n market_id\nFROM market_meta\nwhere simulation='$simulation'\ngroup by market_id ;", "refresh": 2, "regex": "", - "skipUrlSync": false, "sort": 1, "type": "query" } ] }, "time": { - "from": "2019-01-01T23:00:00.000Z", - "to": "2019-01-06T22:59:59.000Z" + "from": "2018-12-31T23:00:00.000Z", + "to": "2019-01-08T23:00:00.000Z" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": { "refresh_intervals": [ "5s", @@ -847,6 +1046,6 @@ "timezone": "", "title": "ASSUME - Nodal view", "uid": "nodalview", - "version": 2, + "version": 21, "weekStart": "" -} +} \ No newline at end of file diff --git a/docker_configs/datasources/datasource.yml b/docker_configs/datasources/datasource.yml index d65932ad2..00080fc3e 100644 --- a/docker_configs/datasources/datasource.yml +++ b/docker_configs/datasources/datasource.yml @@ -22,7 +22,7 @@ datasources: password: assume jsonData: sslmode: "disable" - postgresVersion: 1200 + postgresVersion: 1600 timescaledb: true isDefault: true editable: true diff --git a/docker_configs/mqtt.conf b/docker_configs/mqtt.conf index f7a57a348..d2585ebc1 100644 --- a/docker_configs/mqtt.conf +++ b/docker_configs/mqtt.conf @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # https://github.com/eclipse/mosquitto/blob/master/mosquitto.conf listener 1883 +set_tcp_nodelay true allow_anonymous true max_keepalive 3600 diff --git a/docs/source/market_mechanism.rst b/docs/source/market_mechanism.rst index 631d0831e..de2e1f955 100644 --- a/docs/source/market_mechanism.rst +++ b/docs/source/market_mechanism.rst @@ -34,7 +34,6 @@ The available market mechanisms are the following: 5. :py:meth:`assume.markets.clearing_algorithms.complex_clearing.ComplexClearingRole` 6. :py:meth:`assume.markets.clearing_algorithms.complex_clearing_dmas.ComplexDmasClearingRole` 7. :py:meth:`assume.markets.clearing_algorithms.redispatch.RedispatchMarketRole` -8. :py:meth:`assume.markets.clearing_algorithms.nodal_pricing.NodalMarketRole` 9. :py:meth:`assume.markets.clearing_algorithms.contracts.PayAsBidContractRole` The :code:`PayAsClearRole` performs an electricity market clearing using a pay-as-clear mechanism. diff --git a/examples/inputs/example_01d/config.yaml b/examples/inputs/example_01d/config.yaml index 9829c7a39..af1404356 100644 --- a/examples/inputs/example_01d/config.yaml +++ b/examples/inputs/example_01d/config.yaml @@ -52,39 +52,6 @@ base: payment_mechanism: pay_as_bid backup_marginal_cost: 10000 - -nodal_case: - start_date: 2019-01-01 00:00 - end_date: 2019-01-06 00:00 - time_step: 1h - save_frequency_hours: 24 - - markets_config: - DAM: - operator: EOM_operator - product_type: energy - products: - - duration: 1h - count: 24 - first_delivery: 24h - opening_frequency: 24h - opening_duration: 20h - volume_unit: MWh - maximum_bid_volume: 100000 - maximum_bid_price: 3000 - minimum_bid_price: -500 - price_unit: EUR/MWh - market_mechanism: nodal - additional_fields: - - node - - min_power - - max_power - param_dict: - network_path: . - solver: highs - payment_mechanism: pay_as_clear - backup_marginal_cost: 10000 - zonal_case: start_date: 2019-01-01 00:00 end_date: 2019-01-06 00:00 diff --git a/examples/inputs/example_01d/lines.csv b/examples/inputs/example_01d/lines.csv index 797f01975..37f8d64c5 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