IBM / dse-do-dashboard

Plotly/Dash dashboard for Decision Optimization projects in IBM Cloud Pak for Data
Apache License 2.0
4 stars 3 forks source link

Feature: scenario compare between multiple scenarios #7

Open victorterpstra opened 2 years ago

victorterpstra commented 2 years ago

Allow a user to select multiple scenarios for a multi-scenario compare view. Load data from all these scenarios Custom visualization pages can then create plots over multiple scenarios.

Technical suggestions:

victorterpstra commented 2 years ago

Notes:

  1. End goal:

    • a PlotlyManager with properties sceanrio_compare_inputs, scenario_compare_outputs
    • Inputs include the Scenario table (only for the selected scenarios)
    • All DataFrames contains primary key scenario_name
    • The 'create_plotly_fig' method typicaly creates a dedicated scenario-compare figure
    • So, like the DO Experiment, we get dedicated scenario compare charts / pages
    • (Although the plotly method could automatically switch between views)
  2. Select scenarios to compare:

    • Include the current scenario
    • Include any 'reference scenario'
    • Include selected scenarios
  3. DB query and caching

    • New cached db query procedure (in addition to to current cached procedure for single scenario)
    • Use caching based on set of scenario-names.
  4. Dashboard VisualizationPage configuration

    • Keep same set of input/output tables specification
    • Include a load_scenario_compare_data flag: if True, loads the scenario-compare inputs/outputs (This avoids loading scenario-compare data for pages that do not use/support scenario-compare)
  5. ScenarioDbManager APIs:

    • Query DB table for scenario_name IN list of scenario-names. (I.e. do not query table multiple times per scenario)
    • def read_multi_scenario_tables_from_db(self, scenario_names: List[str], input_table_names: Optional[List[str]] = None, output_table_names: Optional[List[str]] = None) -> (Inputs, Outputs):