7. Visualization

7.1. Background

GridPath constains a Visualization package that helps user visualize some of the inputs and outputs of the model. The package uses the Bokeh interactive plotting library and is located in the ./viz folder. The plotting data is pulled directly from the GridPath database, so users need a functioning database to use this package.

The plotting package consists of a set of plotting scripts that can be called either from the command line or through the GridPath User Interface. For instance, to obtain a plot that shows the total installed capacity across modeling periods for a certain scenario, you can run the following command:

gridpath_viz_capacity_total_plot --scenario test --load_zone CAISO --show
The available plotting scripts currently include:
  • gridpath_viz_capacity_factor_plot

  • gridpath_viz_capacity_new_plot

  • gridpath_viz_capacity_retired_plot

  • gridpath_viz_capacity_total_loadzone_comparison_plot

  • gridpath_viz_capacity_total_plot

  • gridpath_viz_capacity_total_scenario_comparison_plot

  • gridpath_viz_carbon_plot

  • gridpath_viz_cost_plot

  • gridpath_viz_curtailment_hydro_heatmap_plot

  • gridpath_viz_curtailment_variable_heatmap_plot

  • gridpath_viz_dispatch_plot

  • gridpath_viz_energy_plot

  • gridpath_viz_energy_target_plot

  • gridpath_viz_project_operations_plot

See the –help menu for usage details. The next section provides a brief description of each plotting script and its arguments. As GridPath evolves we expect the list of built-in visualizations to grow.

7.2. Plotting scripts

Note

Generally capacity expansion problems will have only one subproblem/ stage. If not specified, the plotting module assumes the subproblem and stage are equal to 1, which is the default if there’s only one subproblem/stage.

7.2.1. gridpath.viz.capacity_factor_plot

Make plot of capacity factor by period and project for a specified scenario/stage.

usage: capacity_factor_plot.py [-h] [--database DATABASE]
                               [--plot_write_directory PLOT_WRITE_DIRECTORY]
                               [--scenario_name_in_title] [--ylimit YLIMIT]
                               [--show] [--return_json]
                               [--scenario_id SCENARIO_ID]
                               [--scenario SCENARIO] --load_zone LOAD_ZONE
                               [--subproblem SUBPROBLEM] [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.2. gridpath.viz.capacity_new_plot

Create plot of new capacity by period and technology for a given scenario/zone/subproblem/stage.

usage: capacity_new_plot.py [-h] [--database DATABASE]
                            [--plot_write_directory PLOT_WRITE_DIRECTORY]
                            [--scenario_name_in_title] [--ylimit YLIMIT]
                            [--show] [--return_json]
                            [--scenario_id SCENARIO_ID] [--scenario SCENARIO]
                            --load_zone LOAD_ZONE [--subproblem SUBPROBLEM]
                            [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.3. gridpath.viz.capacity_retired_plot

Create plot of retired capacity by period and technology for a given scenario/zone/subproblem/stage.

usage: capacity_retired_plot.py [-h] [--database DATABASE]
                                [--plot_write_directory PLOT_WRITE_DIRECTORY]
                                [--scenario_name_in_title] [--ylimit YLIMIT]
                                [--show] [--return_json]
                                [--scenario_id SCENARIO_ID]
                                [--scenario SCENARIO] --load_zone LOAD_ZONE
                                [--subproblem SUBPROBLEM] [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.4. gridpath.viz.capacity_total_plot

Create plot of total capacity by period and technology for a given scenario/zone/subproblem/stage.

usage: capacity_total_plot.py [-h] [--database DATABASE]
                              [--plot_write_directory PLOT_WRITE_DIRECTORY]
                              [--scenario_name_in_title] [--ylimit YLIMIT]
                              [--show] [--return_json]
                              [--scenario_id SCENARIO_ID]
                              [--scenario SCENARIO] --load_zone LOAD_ZONE
                              [--subproblem SUBPROBLEM] [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.5. gridpath.viz.capacity_total_loadzone_comparison_plot

Create plot of total capacity by load zone and technology for a given scenario/period/subproblem/stage.

usage: capacity_total_loadzone_comparison_plot.py [-h] [--database DATABASE]
                                                  [--plot_write_directory PLOT_WRITE_DIRECTORY]
                                                  [--scenario_name_in_title]
                                                  [--ylimit YLIMIT] [--show]
                                                  [--return_json]
                                                  [--scenario_id SCENARIO_ID]
                                                  [--scenario SCENARIO]
                                                  --period PERIOD
                                                  [--subproblem SUBPROBLEM]
                                                  [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--period

The name of the load zone. Required.

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.6. gridpath.viz.capacity_total_scenario_comparison_plot

Create plot of total capacity by scenario and technology for a given period/zone/subproblem/stage. TODO: remove this and allow capacity_total to specify multiple scenarios?

usage: capacity_total_scenario_comparison_plot.py [-h] [--database DATABASE]
                                                  [--plot_write_directory PLOT_WRITE_DIRECTORY]
                                                  [--scenario_name_in_title]
                                                  [--ylimit YLIMIT] [--show]
                                                  [--return_json] --period
                                                  PERIOD --load_zone LOAD_ZONE
                                                  [--subproblem SUBPROBLEM]
                                                  [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--period

The selected modeling period. Required.

--load_zone

The name of the load zone. Required.

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.7. gridpath.viz.carbon_plot

Create plot of carbon emissions by period for a given zone/subproblem/stage.

usage: carbon_plot.py [-h] [--database DATABASE]
                      [--plot_write_directory PLOT_WRITE_DIRECTORY]
                      [--scenario_name_in_title] [--ylimit YLIMIT] [--show]
                      [--return_json] [--scenario_id SCENARIO_ID]
                      [--scenario SCENARIO] --carbon_cap_zone CARBON_CAP_ZONE
                      [--subproblem SUBPROBLEM] [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--carbon_cap_zone

The name of the carbon cap zone. Required

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.8. gridpath.viz.energy_target_plot

Create plot of energy_target by period for a given zone/subproblem/stage.

usage: energy_target_plot.py [-h] [--database DATABASE]
                             [--plot_write_directory PLOT_WRITE_DIRECTORY]
                             [--scenario_name_in_title] [--ylimit YLIMIT]
                             [--show] [--return_json]
                             [--scenario_id SCENARIO_ID] [--scenario SCENARIO]
                             --energy_target_zone ENERGY_TARGET_ZONE
                             [--subproblem SUBPROBLEM] [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--energy_target_zone

The name of the RPS zone. Required

--subproblem

The subproblem ID. Defaults to 1.

Default: 1

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.9. gridpath.viz.cost_plot

Make plot of costs by period for a certain scenario/zone/stage

usage: cost_plot.py [-h] [--database DATABASE]
                    [--plot_write_directory PLOT_WRITE_DIRECTORY]
                    [--scenario_name_in_title] [--ylimit YLIMIT] [--show]
                    [--return_json] [--scenario_id SCENARIO_ID]
                    [--scenario SCENARIO] --load_zone LOAD_ZONE
                    [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.10. gridpath.viz.dispatch_plot

Make results dispatch plot for a specified zone/stage/set of timepoints

usage: dispatch_plot.py [-h] [--database DATABASE]
                        [--plot_write_directory PLOT_WRITE_DIRECTORY]
                        [--scenario_name_in_title] [--ylimit YLIMIT] [--show]
                        [--return_json] [--scenario_id SCENARIO_ID]
                        [--scenario SCENARIO] --load_zone LOAD_ZONE
                        [--starting_tmp STARTING_TMP]
                        [--ending_tmp ENDING_TMP] [--stage STAGE]
                        [--weather_iteration WEATHER_ITERATION]
                        [--hydro_iteration HYDRO_ITERATION]
                        [--availability_iteration AVAILABILITY_ITERATION]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--starting_tmp

The starting timepoint. Defaults to None (first timepoint)

--ending_tmp

The ending timepoint. Defaults to None (last timepoint)

--stage

The stage ID. Defaults to 1.

Default: 1

--weather_iteration

Defaults to 0.

Default: 0

--hydro_iteration

Defaults to 0.

Default: 0

--availability_iteration

Defaults to 0.

Default: 0

7.2.11. gridpath.viz.energy_plot

Make plot of energy by period and technology for a specified zone/stage

usage: energy_plot.py [-h] [--database DATABASE]
                      [--plot_write_directory PLOT_WRITE_DIRECTORY]
                      [--scenario_name_in_title] [--ylimit YLIMIT] [--show]
                      [--return_json] [--scenario_id SCENARIO_ID]
                      [--scenario SCENARIO] [--load_zone LOAD_ZONE]
                      [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.12. gridpath.viz.curtailment_hydro_heatmap_plot

Create plot of scheduled curtailment heatmap (by month and hour)

usage: curtailment_hydro_heatmap_plot.py [-h] [--database DATABASE]
                                         [--plot_write_directory PLOT_WRITE_DIRECTORY]
                                         [--scenario_name_in_title]
                                         [--ylimit YLIMIT] [--show]
                                         [--return_json]
                                         [--scenario_id SCENARIO_ID]
                                         [--scenario SCENARIO] --load_zone
                                         LOAD_ZONE --period PERIOD
                                         [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--period

The desired modeling period to plot. Required.

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.13. gridpath.viz.curtailment_variable_heatmap_plot

Create plot of scheduled curtailment heatmap (by month and hour)

usage: curtailment_variable_heatmap_plot.py [-h] [--database DATABASE]
                                            [--plot_write_directory PLOT_WRITE_DIRECTORY]
                                            [--scenario_name_in_title]
                                            [--ylimit YLIMIT] [--show]
                                            [--return_json]
                                            [--scenario_id SCENARIO_ID]
                                            [--scenario SCENARIO] --load_zone
                                            LOAD_ZONE --period PERIOD
                                            [--stage STAGE]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--load_zone

The name of the load zone. Required.

--period

The desired modeling period to plot. Required.

--stage

The stage ID. Defaults to 1.

Default: 1

7.2.14. gridpath.viz.project_operations_plot

Make plot of project operations by timepoint a specified project/period/stage. Assumes project is of the type “capacity commit”

Note: either there are no hovertools on step function (Bokeh issue #7419) and working hovertools on stacked bar chart, or we can go continuous but then the hovertool doesn’t work for the stacked areas (#9182)

usage: project_operations_plot.py [-h] [--database DATABASE]
                                  [--plot_write_directory PLOT_WRITE_DIRECTORY]
                                  [--scenario_name_in_title] [--ylimit YLIMIT]
                                  [--show] [--return_json]
                                  [--scenario_id SCENARIO_ID]
                                  [--scenario SCENARIO] --project PROJECT
                                  --period PERIOD [--stage STAGE]
                                  [--horizon_start HORIZON_START]
                                  [--horizon_end HORIZON_END]

Named Arguments

--database

The database file path relative to the current working directory. Defaults to ../db/io.db

--plot_write_directory

The path to the base directory in which to save the plot html file. Note: the file will be saved in a subfolder of this base directory, generally ‘scenario_name/results/figures’

Default: “../scenarios”

--scenario_name_in_title

Include the scenario name in the plot title.

Default: False

--ylimit

Set y-axis limit.

--show

Show figure and save html file

Default: False

--return_json

Return plot as a json file.

Default: False

--scenario_id

The scenario ID. Required if no –scenario is specified.

--scenario

The scenario name. Required if no –scenario_id is specified.

--project

The name of the project. Required

--period

The desired modeling period. Required

--stage

The stage ID. Defaults to 1.

Default: 1

--horizon_start

The desired starting horizon. Assumes horizonsare a set of increasing numbers. Optional

--horizon_end

The desired ending horizon. Assumes horizons area set of increasing numbers. Optional