Postprocessing and Diagnostic Visualizations

class celavi.diagnostic_viz.DiagnosticViz(facility_inventories: Dict[str, celavi.inventory.FacilityInventory], output_plot_filename: str, keep_cols: List[str], start_year: int, timesteps_per_year: int, component_count: Dict[str, int], var_name: str, value_name: str, run: int)

This class creates diagnostic visualizations from a context after the model run has been executed.

__init__(facility_inventories: Dict[str, celavi.inventory.FacilityInventory], output_plot_filename: str, keep_cols: List[str], start_year: int, timesteps_per_year: int, component_count: Dict[str, int], var_name: str, value_name: str, run: int)
Parameters
  • facility_inventories (Dict[str, FacilityInventory]) – The dictionary of facility inventories from the Context

  • output_plot_filename (str) – The absolute path to the filename that will hold the final generated plot.

  • keep_cols (List[str]) – This is a list of the possible material names (for material facility inventories) or a list of the possible component names (for count facility inventories)

  • start_year (int) – The start year for the DES model.

  • timesteps_per_year (int) – The timesteps per year for the DES model.

  • component_count (Dict[str, int]) – Dictionary where the keys are component names and the values are the number of components in one technology unit.

  • var_name (str) – The name of the generalized var column, like ‘material’ or ‘unit’.

  • value_name (str) – The name of the generalized value column, like ‘count’ or ‘tonnes’.

  • run (int) – Model run identifier for uncertainty runs within a scenario.

gather_and_melt_cumulative_histories() → pandas.core.frame.DataFrame

This gathers the cumulative histories in a way that they can be plotted

Returns

A dataframe with the cumulative histories gathered together.

Return type

pd.DataFrame

generate_plots()

This method generates the history plots.