concrete_plotter¶
- class pyrecodes.plotter.concrete_plotter.ConcretePlotter¶
Bases:
objectClass that plots resilience assessment results in two formats:1. The supply, demand, and consumption dynamics during recovery for a list of resources.2. A Gantt chart that shows the recovery activities for each component in the system.- add_warmup(warmup: int, lists_to_extend: list[list]) list[list]¶
- assign_activity_lanes(component_recovery_progress: dict, mode: str) tuple[dict, int]¶
Assign each activity to a vertical lane for rendering.
‘stack’ – all activities share one lane (original behaviour, overlapping activities overwrite each other) ‘separate’ – each activity gets its own lane regardless of overlap ‘parallel’ – greedy assignment: a new lane is only opened when activities actually overlap
- collect_all_households(components: list) list¶
- get_household_location_counts(components: list) dict¶
- get_met_demand_over_time(components: list, resource_name: str) list¶
- get_supply_demand_consumption(system: System, resource_name: str, resilience_calculator_id=0) list[list]¶
- Method returns a list of lists containing the supply, demand, and consumption dynamics during recovery for a list of resources.Default values are set for the resilience calculator id. It is assumed that the first resilience calculator in system.resilience_calculators list is a recodes calculator with scope=’All’. The user can specify a different resilience calculator id as long as it is a recodes calculator.
- plot_component_gantt_bar(component_row: int, component: Component, axis_object: axis, mode: str = 'stack') list¶
- plot_household_location_over_time(components: list, x_axis_label='Time step [day]') None¶
- plot_household_movement(components: list, axis_object: axis) None¶
- plot_met_demand_over_time(components: list, resource_name: str, x_axis_label='Time step [day]') None¶
- plot_single_household_movement(household, household_count: int, axis_object: axis, bar_width=0.5) list¶
- plot_single_resource(time_steps: list, supply: list, demand: list, consumption: list, axis_object: axis, warmup=0, show=False, supply_label='Supply', demand_label='Demand', consumption_label='Consumption', unmet_demand_label='Unmet Demand') None¶
- plot_supply_demand_dynamics(system: System, resources: list[str], units: list[str], resilience_calculator_id=0, x_axis_label='Time step [day]')¶
- Method plots regional supply, demand, and consumption dynamics during recovery for a list of resources.Default values are set for:- the resilience calculator id. It is assumed that the first resilience calculator in system.resilience_calculators list is a recodes calculator with scope=’All’. The user can specify a different resilience calculator id as long as it is a recodes calculator.- the x-axis label. It is assumed that the x-axis label is ‘Time step [day]’.
- reorder_legend(order: list, ax=None, **legend_kwargs) None¶
- save_component_recovery_progress(components: list)¶
- save_current_figure(savename='Figure.png', dpi=300) None¶
- save_supply_demand_consumption(system, resource_names: list, resilience_calculator_id=0)¶
- set_gantt_chart_legend(recovery_activities_legend: list, axis_object: axis, legend_colors: dict | None = None) None¶
- setup_gantt_chart_fig(x_axis_label, num_components: int, mode: str) axis¶
- setup_lor_plot_fig(x_axis_label: str, y_axis_label: str) axis¶