diff --git a/docs/code/capacity_vs_cf_solar_western_scatter.py b/docs/code/capacity_vs_cf_solar_western_scatter.py new file mode 100644 index 00000000..f81db36e --- /dev/null +++ b/docs/code/capacity_vs_cf_solar_western_scatter.py @@ -0,0 +1,12 @@ +from powersimdata import Scenario +from powersimdata.utility.helpers import PrintManager + +from postreise.plot.plot_scatter_capacity_vs_capacity_factor import ( + plot_scatter_capacity_vs_capacity_factor, +) + +with PrintManager(): + scenario = Scenario(1171) + plot_scatter_capacity_vs_capacity_factor( + scenario, "Western", "solar", percentage=True + ) diff --git a/docs/code/capacity_vs_cost_curve_slope_coal_eastern_scatter.py b/docs/code/capacity_vs_cost_curve_slope_coal_eastern_scatter.py new file mode 100644 index 00000000..5355dfd9 --- /dev/null +++ b/docs/code/capacity_vs_cost_curve_slope_coal_eastern_scatter.py @@ -0,0 +1,10 @@ +from powersimdata import Scenario +from powersimdata.utility.helpers import PrintManager + +from postreise.plot.plot_scatter_capacity_vs_cost_curve_slope import ( + plot_scatter_capacity_vs_cost_curve_slope, +) + +with PrintManager(): + scenario = Scenario(3287) + plot_scatter_capacity_vs_cost_curve_slope(scenario, "Eastern", "coal") diff --git a/docs/code/capacity_vs_curtailment_solar_western_scatter.py b/docs/code/capacity_vs_curtailment_solar_western_scatter.py new file mode 100644 index 00000000..2b5787bf --- /dev/null +++ b/docs/code/capacity_vs_curtailment_solar_western_scatter.py @@ -0,0 +1,10 @@ +from powersimdata import Scenario +from powersimdata.utility.helpers import PrintManager + +from postreise.plot.plot_scatter_capacity_vs_curtailment import ( + plot_scatter_capacity_vs_curtailment, +) + +with PrintManager(): + scenario = Scenario(3287) + plot_scatter_capacity_vs_curtailment(scenario, "Western", "solar", percentage=True) diff --git a/docs/code/capacity_vs_generation_bar.py b/docs/code/capacity_vs_generation_bar.py new file mode 100644 index 00000000..b4d0bf75 --- /dev/null +++ b/docs/code/capacity_vs_generation_bar.py @@ -0,0 +1,15 @@ +from powersimdata.utility.helpers import PrintManager + +from postreise.plot.plot_bar_generation_vs_capacity import ( + plot_bar_generation_vs_capacity, +) + +with PrintManager(): + plot_bar_generation_vs_capacity( + areas=["CA", "Western"], + scenario_ids=[2497, 3101], + scenario_names=[ + "Western 90% clean and 10% nuclear", + "Western 90% clean and 10% nuclear with transmission upgrade", + ], + ) diff --git a/docs/code/capacity_vs_generation_pie.py b/docs/code/capacity_vs_generation_pie.py new file mode 100644 index 00000000..39a789b7 --- /dev/null +++ b/docs/code/capacity_vs_generation_pie.py @@ -0,0 +1,15 @@ +from powersimdata.utility.helpers import PrintManager + +from postreise.plot.plot_pie_generation_vs_capacity import ( + plot_pie_generation_vs_capacity, +) + +with PrintManager(): + plot_pie_generation_vs_capacity( + areas=["WA", "Western"], + scenario_ids=[2497, 3101], + scenario_names=[ + "Western 90% clean and 10% nuclear", + "Western 90% clean and 10% nuclear \n with transmission upgrade", + ], + ) diff --git a/docs/code/curtailment_eastern.py b/docs/code/curtailment_eastern.py new file mode 100644 index 00000000..b92f4707 --- /dev/null +++ b/docs/code/curtailment_eastern.py @@ -0,0 +1,21 @@ +import matplotlib.pyplot as plt +from powersimdata import Scenario + +from postreise.plot.plot_curtailment_ts import plot_curtailment_time_series + +scenario = Scenario(403) + +t2c = {"wind_curtailment": "blue", "solar_curtailment": "blue"} + +plot_curtailment_time_series( + scenario, + "Eastern", + ["wind", "solar"], + time_freq="D", + t2c=t2c, + label_fontsize=30, + title_fontsize=35, + tick_fontsize=25, + legend_fontsize=25, +) +plt.show() diff --git a/docs/code/curtailment_usa_heatmap.py b/docs/code/curtailment_usa_heatmap.py new file mode 100644 index 00000000..19e26da6 --- /dev/null +++ b/docs/code/curtailment_usa_heatmap.py @@ -0,0 +1,21 @@ +from powersimdata import Scenario + +from postreise.analyze.generation.curtailment import calculate_curtailment_time_series +from postreise.plot.plot_heatmap import plot_heatmap + +scenario = Scenario(3287) +curtailment = calculate_curtailment_time_series(scenario).sum(axis=1) + +plot_heatmap( + curtailment, + cmap="PiYG_r", + scale=1e-3, + cbar_label="GW", + vmin=0, + vmax=250, + cbar_tick_values=[0, 50, 100, 150, 200, 250], + cbar_tick_labels=["0", "50", "100", "150", "200", "≥250"], + time_zone="ETC/GMT+6", + time_zone_label="(CST)", + contour_levels=[250], +) diff --git a/docs/code/emission_bar.py b/docs/code/emission_bar.py new file mode 100644 index 00000000..b54fa93c --- /dev/null +++ b/docs/code/emission_bar.py @@ -0,0 +1,24 @@ +from powersimdata import Scenario +from powersimdata.utility.helpers import PrintManager + +from postreise.plot.plot_carbon_bar import plot_carbon_bar + +scenarioA = Scenario(2497) +scenarioB = Scenario(3101) + +with PrintManager(): + scenarioA = Scenario(2497) + scenarioB = Scenario(3101) + +plot_carbon_bar( + scenarioA, + scenarioB, + labels=[ + "Western" + "\n" + "90% clean and 10% nuclear", + "Western" + + "\n" + + "90% clean and 10% nuclear" + + "\n" + + "with transmission upgrade", + ], +) diff --git a/docs/code/emission_map.py b/docs/code/emission_map.py new file mode 100644 index 00000000..693e75bf --- /dev/null +++ b/docs/code/emission_map.py @@ -0,0 +1,11 @@ +from bokeh.io import show +from powersimdata import Scenario + +from postreise.plot.plot_carbon_map import map_carbon_emission_generator + +scenario = Scenario(3287) + +emission_map = map_carbon_emission_generator( + scenario, coordinate_rounding=0, scale_factor=0.75 +) +show(emission_map) diff --git a/docs/code/emission_map_carbon_diff.py b/docs/code/emission_map_carbon_diff.py new file mode 100644 index 00000000..25cbe947 --- /dev/null +++ b/docs/code/emission_map_carbon_diff.py @@ -0,0 +1,12 @@ +from bokeh.io import show +from powersimdata import Scenario + +from postreise.plot.plot_carbon_map import map_carbon_emission_difference + +scenarioA = Scenario(2497) +scenarioB = Scenario(3101) + +emission_difference_map = map_carbon_emission_difference( + scenarioA, scenarioB, coordinate_rounding=0 +) +show(emission_difference_map) diff --git a/docs/code/energy_emission_stack_bar.py b/docs/code/energy_emission_stack_bar.py new file mode 100644 index 00000000..08a1895e --- /dev/null +++ b/docs/code/energy_emission_stack_bar.py @@ -0,0 +1,8 @@ +from powersimdata import Scenario + +from postreise.plot.plot_energy_carbon_stack import plot_n_scenarios + +scenarioA = Scenario(2497) +scenarioB = Scenario(3101) + +plot_n_scenarios(scenarioA, scenarioB) diff --git a/docs/code/generation_stack_western_ts.py b/docs/code/generation_stack_western_ts.py new file mode 100644 index 00000000..32f92cb1 --- /dev/null +++ b/docs/code/generation_stack_western_ts.py @@ -0,0 +1,65 @@ +from powersimdata import Scenario + +from postreise.plot.plot_generation_ts_stack import plot_generation_time_series_stack + +t2c = { + "nuclear": "#173FA5", + "hydro": "#0090FF", + "geothermal": "#CC67F3", + "other": "#8B36FF", + "dfo": "#31E8CB", + "coal": "#37404C", + "ng": "#72818F", + "solar": "#FFBB45", + "wind": "#78D911", + "solar_curtailment": "#FFBB45", + "wind_curtailment": "#78D911", +} + +t2l = { + "nuclear": "Nuclear", + "hydro": "Hydro", + "geothermal": "Geothermal", + "other": "Other", + "dfo": "Distillate Fuel Oil", + "coal": "Coal", + "ng": "Natural Gas", + "solar": "Solar", + "wind": "Wind", + "wind_offshore": "Wind Offshore", + "biomass": "Biomass", + "storage": "Storage", + "solar_curtailment": "Solar Curtailment", + "wind_curtailment": "Wind Curtailment", + "wind_offshore_curtailment": "Offshore Wind Curtailment", +} + +t2hc = {"solar_curtailment": "#996100", "wind_curtailment": "#4e8e0b"} + +scenario = Scenario(1171) + +resources = [ + "nuclear", + "coal", + "hydro", + "geothermal", + "other", + "dfo", + "ng", + "solar", + "wind", + "storage", + "solar_curtailment", + "wind_curtailment", +] + +plot_generation_time_series_stack( + scenario, + "Western", + resources, + time_freq="D", + normalize=True, + t2c=t2c, + t2l=t2l, + t2hc=t2hc, +) diff --git a/docs/code/interconnection_map.py b/docs/code/interconnection_map.py new file mode 100644 index 00000000..535b4fef --- /dev/null +++ b/docs/code/interconnection_map.py @@ -0,0 +1,10 @@ +from bokeh.io import show +from powersimdata import Scenario + +from postreise.plot.plot_interconnection_map import map_interconnections + +scenario = Scenario(3287) +grid = scenario.get_grid() + +transmission_map = map_interconnections(grid) +show(transmission_map) diff --git a/docs/code/lmp_usa_map.py b/docs/code/lmp_usa_map.py new file mode 100644 index 00000000..73c13f18 --- /dev/null +++ b/docs/code/lmp_usa_map.py @@ -0,0 +1,9 @@ +from bokeh.io import show +from powersimdata import Scenario + +from postreise.plot.plot_lmp_map import map_lmp + +scenario = Scenario(3287) + +lmp_map = map_lmp(scenario) +show(lmp_map) diff --git a/docs/code/pf_snapshot_map.py b/docs/code/pf_snapshot_map.py new file mode 100644 index 00000000..d08999a9 --- /dev/null +++ b/docs/code/pf_snapshot_map.py @@ -0,0 +1,13 @@ +import pandas as pd +from bokeh.io import show +from powersimdata import Scenario + +from postreise.plot.plot_powerflow_snapshot import plot_powerflow_snapshot + +scenario = Scenario(3287) +grid = scenario.get_grid() + +pf_map = plot_powerflow_snapshot( + scenario, pd.Timestamp(2016, 11, 2, 22), legend_font_size=20 +) +show(pf_map) diff --git a/docs/code/shortfall_nv.py b/docs/code/shortfall_nv.py new file mode 100644 index 00000000..072b4816 --- /dev/null +++ b/docs/code/shortfall_nv.py @@ -0,0 +1,25 @@ +import inspect +import os + +from powersimdata.design.generation.clean_capacity_scaling import load_targets_from_csv +from powersimdata.utility.helpers import PrintManager + +import postreise +from postreise.plot.plot_bar_shortfall import plot_bar_shortfall + +data = os.path.join(os.path.dirname(inspect.getfile(postreise)), "data") +target = load_targets_from_csv( + os.path.join(data, "2030_USA_Clean_Energy_Regular_Targets.csv") +) +with PrintManager(): + plot_bar_shortfall( + "Nevada", + [2497, 3101], + target, + scenario_names=[ + "Western 90% clean and 10% nuclear", + "Western 90% clean and 10% nuclear" + "\n" + "with transmission upgrade", + ], + baseline_scenario=2497, + baseline_scenario_name="Western 90% clean and 10% nuclear", + ) diff --git a/docs/code/utilization_map.py b/docs/code/utilization_map.py new file mode 100644 index 00000000..b99174e8 --- /dev/null +++ b/docs/code/utilization_map.py @@ -0,0 +1,8 @@ +from bokeh.io import show +from powersimdata import Scenario + +from postreise.plot.plot_utilization_map import map_utilization + +scenario = Scenario("3287") +util_map = map_utilization(scenario, plot_states_kwargs={"background_map": False}) +show(util_map) diff --git a/docs/plot.rst b/docs/plot.rst index 51f9174c..78899022 100644 --- a/docs/plot.rst +++ b/docs/plot.rst @@ -12,37 +12,16 @@ Transmission - get a power flow snapshot (`notebook `__) - .. code-block:: python - - from bokeh.io import show - import pandas as pd - from powersimdata import Scenario - - from postreise.plot.plot_powerflow_snapshot import plot_powerflow_snapshot - - - scenario = Scenario(3287) - grid = scenario.get_grid() - - pf_map = plot_powerflow_snapshot( - scenario, pd.Timestamp(2016, 11, 2, 22), legend_font_size=20 - ) - show(pf_map) + .. include:: code/pf_snapshot_map.py + :code: python .. image:: img/single/pf_snapshot_map.png - get utilization map (`notebook `__) - .. code-block:: python - - from bokeh.io import show - from powersimdata import Scenario - - from postreise.plot.plot_utilization_map import map_utilization - - util_map = map_utilization(scenario, plot_states_kwargs={"background_map": False}) - show(util_map) + .. include:: code/utilization_map.py + :code: python .. raw:: html :file: img/single/utilization_map.html @@ -53,20 +32,8 @@ Emission - show carbon emission by generator type using circles overlay on a map (`notebook `__) - .. code-block:: python - - from bokeh.io import show - from powersimdata import Scenario - - from postreise.plot.plot_carbon_map import map_carbon_emission_generator - - - scenario = Scenario(3287) - - emission_map = map_carbon_emission_generator( - scenario, coordinate_rounding=0, scale_factor=0.75 - ) - show(emission_map) + .. include:: code/emission_map.py + :code: python .. raw:: html :file: img/single/emission_map.html @@ -77,95 +44,16 @@ Generator Capacity and Generation - plot stacked generation time series in an area (`notebook `__) - .. code-block:: python - - from powersimdata import Scenario - - from postreise.plot.plot_generation_ts_stack import ( - plot_generation_time_series_stack, - ) - - - t2c = { - "nuclear": "#173FA5", - "hydro": "#0090FF", - "geothermal": "#CC67F3", - "other": "#8B36FF", - "dfo": "#31E8CB", - "coal": "#37404C", - "ng": "#72818F", - "solar": "#FFBB45", - "wind": "#78D911", - "solar_curtailment": "#FFBB45", - "wind_curtailment": "#78D911", - } - - t2l = { - "nuclear": "Nuclear", - "hydro": "Hydro", - "geothermal": "Geothermal", - "other": "Other", - "dfo": "Distillate Fuel Oil", - "coal": "Coal", - "ng": "Natural Gas", - "solar": "Solar", - "wind": "Wind", - "wind_offshore": "Wind Offshore", - "biomass": "Biomass", - "storage": "Storage", - "solar_curtailment": "Solar Curtailment", - "wind_curtailment": "Wind Curtailment", - "wind_offshore_curtailment": "Offshore Wind Curtailment", - } - - t2hc = { - "solar_curtailment": "#996100", - "wind_curtailment": "#4e8e0b" - } - - scenario = Scenario(1171) - - resources = [ - "nuclear", - "coal", - "hydro", - "geothermal", - "other", - "dfo", - "ng", - "solar", - "wind", - "storage", - "solar_curtailment", - "wind_curtailment", - ] - - plot_generation_time_series_stack( - scenario, "Western", resources, time_freq="D", normalize=True, t2c=t2c, t2l=t2l, - t2hc=t2hc - ) + .. include:: code/generation_stack_western_ts.py + :code: python .. image:: img/single/generation_stack_western_ts.png - plot capacity vs capacity factor of generators in an area (`notebook `__) - .. code-block:: python - - from powersimdata import Scenario - from powersimdata.utility.helpers import PrintManager - - from postreise.plot.plot_scatter_capacity_vs_capacity_factor import ( - plot_scatter_capacity_vs_capacity_factor - ) - - - with PrintManager(): - scenario = Scenario(1171) - - plot_scatter_capacity_vs_capacity_factor( - scenario, "Western", "solar", percentage=True - ) + .. include:: code/capacity_vs_cf_solar_western_scatter.py + :code: python .. image:: img/single/capacity_vs_cf_solar_western_scatter.png @@ -175,23 +63,8 @@ Curtailment - plot renewable generators curtailment time series in an area (`notebook `__) - .. code-block:: python - - import matplotlib.pyplot as plt - from powersimdata import Scenario - - from postreise.plot.plot_curtailment_ts import plot_curtailment_time_series - - - scenario = Scenario(403) - - t2c = {"wind_curtailment": "blue", "solar_curtailment": "blue"} - - plot_curtailment_time_series( - scenario, "Eastern", ["wind","solar"], time_freq='D', t2c=t2c, - label_fontsize=30, title_fontsize=35, tick_fontsize=25, legend_fontsize=25, - ) - plt.show() + .. include:: code/curtailment_eastern.py + :code: python .. image:: img/single/curtailment_solar_eastern_ts.png .. image:: img/single/curtailment_wind_eastern_ts.png @@ -199,22 +72,8 @@ Curtailment - plot capacity vs curtailment of generators in an area (`notebook `__) - .. code-block:: python - - from powersimdata import Scenario - from powersimdata.utility.helpers import PrintManager - - from postreise.plot.plot_scatter_capacity_vs_curtailment import ( - plot_scatter_capacity_vs_curtailment - ) - - - with PrintManager(): - scenario = Scenario(3287) - - plot_scatter_capacity_vs_curtailment( - scenario, "Western", "solar", percentage=True - ) + .. include:: code/capacity_vs_curtailment_solar_western_scatter.py + :code: python .. image:: img/single/capacity_vs_curtailment_solar_western_scatter.png @@ -224,42 +83,20 @@ Price - map locational marginal price (`notebook `__) - .. code-block:: python - - from bokeh.io import show - from powersimdata import Scenario - - from postreise.plot.plot_lmp_map import map_lmp - - - scenario = Scenario(3287) - - lmp_map = map_lmp(scenario) - show(lmp_map) + .. include:: code/lmp_usa_map.py + :code: python .. raw:: html :file: img/single/lmp_usa_map.html - - plot capacity vs cost curve slope of generators in an area (`notebook - `__) - - .. code-block:: python - - from powersimdata import Scenario - from powersimdata.utility.helpers import PrintManager - - from postreise.plot.plot_scatter_capacity_vs_cost_curve_slope import ( - plot_scatter_capacity_vs_cost_curve_slope - ) +- plot capacity vs cost curve slope of generators in an area (`notebook + `__) + .. include:: code/capacity_vs_cost_curve_slope_coal_eastern_scatter.py + :code: python - with PrintManager(): - scenario = Scenario(3287) - - plot_scatter_capacity_vs_cost_curve_slope(scenario, "Eastern", "coal") - - .. image:: img/single/capacity_vs_cost_curve_slope_coal_eastern_scatter.png + .. image:: img/single/capacity_vs_cost_curve_slope_coal_eastern_scatter.png General @@ -267,51 +104,15 @@ General - plot any time-series values using a heatmap where each column is one color-coded day (`notebook `__) - .. code-block:: python - - import matplotlib.pyplot as plt - from powersimdata import Scenario - - from postreise.analyze.generation.curtailment import ( - calculate_curtailment_time_series, - ) - from postreise.plot.plot_heatmap import plot_heatmap - - - scenario = Scenario(3287) - curtailment = calculate_curtailment_time_series(scenario).sum(axis=1) - - plot_heatmap( - curtailment, - cmap="PiYG_r", - scale=1e-3, - cbar_label="GW", - vmin=0, - vmax=250, - cbar_tick_values=[0, 50, 100, 150, 200, 250], - cbar_tick_labels=['0', '50', '100', '150', '200', '≥250'], - time_zone="ETC/GMT+6", - time_zone_label="(CST)", - contour_levels=[250], - ) + .. include:: code/curtailment_usa_heatmap.py + :code: python .. image:: img/single/curtailment_usa_heatmap.png - map transmission lines color coded by interconnection - .. code-block:: python - - from bokeh.io import show - from powersimdata import Scenario - - from postreise.plot.plot_interconnection_map import map_interconnections - - - scenario = Scenario(3287) - grid = scenario.get_grid() - - transmission_map = map_interconnections(grid) - show(transmission_map) + .. include:: code/interconnection_map.py + :code: python .. raw:: html :file: img/other/interconnection_map.html @@ -324,24 +125,8 @@ Generator Capacity and Generation - compare generation and capacity in various scenarios through bar charts (`notebook `__) - .. code-block:: python - - from powersimdata.utility.helpers import PrintManager - - from postreise.plot.plot_bar_generation_vs_capacity import ( - plot_bar_generation_vs_capacity, - ) - - - with PrintManager(): - plot_bar_generation_vs_capacity( - areas=["CA", "Western"], - scenario_ids=[2497, 3101], - scenario_names=[ - "Western 90% clean and 10% nuclear", - "Western 90% clean and 10% nuclear with transmission upgrade", - ], - ) + .. include:: code/capacity_vs_generation_bar.py + :code: python .. image:: img/comp/capacity_vs_generation_ca_bar.png .. image:: img/comp/capacity_vs_generation_western_bar.png @@ -349,61 +134,17 @@ Generator Capacity and Generation - compare generation and capacity in various scenarios through pie charts (`notebook `__) - .. code-block:: python - - from powersimdata.utility.helpers import PrintManager - - from postreise.plot.plot_pie_generation_vs_capacity import ( - plot_pie_generation_vs_capacity, - ) + .. include:: code/capacity_vs_generation_pie.py + :code: python - - with PrintManager(): - plot_pie_generation_vs_capacity( - areas=["WA", "Western"], - scenario_ids=[2497, 3101], - scenario_names=[ - "Western 90% clean and 10% nuclear", - "Western 90% clean and 10% nuclear \n with transmission upgrade", - ], - ) .. image:: img/comp/capacity_vs_generation_wa_pie.png .. image:: img/comp/capacity_vs_generation_western_pie.png - compare generation shortfall in various scenarios through bar charts (`notebook `__) - .. code-block:: python - - import inspect - import os - from powersimdata.design.generation.clean_capacity_scaling import ( - load_targets_from_csv, - ) - from powersimdata.utility.helpers import PrintManager - - import postreise - from postreise.plot.plot_bar_shortfall import plot_bar_shortfall - - - data = os.path.join(os.path.dirname(inspect.getfile(postreise)), "data") - target = load_targets_from_csv( - os.path.join(data, "2030_USA_Clean_Energy_Regular_Targets.csv") - ) - with PrintManager(): - plot_bar_shortfall( - "Nevada", - [2497, 3101], - target, - scenario_names=[ - "Western 90% clean and 10% nuclear", - "Western 90% clean and 10% nuclear" - + "\n" - + "with transmission upgrade", - ], - baseline_scenario=2497, - baseline_scenario_name="Western 90% clean and 10% nuclear", - ) + .. include:: code/shortfall_nv.py + :code: python .. image:: img/comp/shortfall_nv.png @@ -413,50 +154,16 @@ Emission - compare total carbon emissions by generator type for 1-to-n scenarios through bar charts (`notebook `__) - .. code-block:: python - - from powersimdata import Scenario - from powersimdata.utility.helpers import PrintManager - - from postreise.plot.plot_carbon_bar import plot_carbon_bar - - - scenarioA = Scenario(2497) - scenarioB = Scenario(3101) - - with PrintManager(): - scenarioA = Scenario(2497) - scenarioB = Scenario(3101) - - plot_carbon_bar( - scenarioA, scenarioB, - labels=["Western" + "\n" + "90% clean and 10% nuclear", - "Western" + "\n" + "90% clean and 10% nuclear" - + "\n" - + "with transmission upgrade"] - ) - + .. include:: code/emission_bar.py + :code: python .. image:: img/comp/emission_bar.png - compare carbon emission by generator type for two scenarios on a map (`notebook `__) - .. code-block:: python - - from bokeh.io import show - from powersimdata import Scenario - - from postreise.plot.plot_carbon_map import map_carbon_emission_difference - - - scenarioA = Scenario(2497) - scenarioB = Scenario(3101) - - emission_difference_map = map_carbon_emission_difference( - scenarioA, scenarioB, coordinate_rounding=0 - ) - show(emission_difference_map) + .. include:: code/emission_map_carbon_diff.py + :code: python .. raw:: html :file: img/comp/emission_map.html @@ -464,16 +171,7 @@ Emission - plot stacked generation and carbon emission for 1-to-n scenarios side-by-side (`notebook `__) - .. code-block:: python - - from powersimdata import Scenario - - from postreise.plot.plot_energy_carbon_stack import plot_n_scenarios - - - scenarioA = Scenario(2497) - scenarioB = Scenario(3101) - - plot_n_scenarios(scenarioA, scenarioB) + .. include:: code/energy_emission_stack_bar.py + :code: python .. image:: img/comp/energy_emission_stack_bar.png diff --git a/tox.ini b/tox.ini index 7df15c95..8fbddd3b 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,7 @@ commands = checkformatting: black . --check --diff checkformatting: isort --check --diff . flake8: flake8 postreise/ + flake8: flake8 --extend-ignore=N816 docs/code [flake8] ignore = E501,W503,E203,E741