sankey_utils
sankey_utils#
- class catlas.sankey.sankey_utils.Sankey(info_dict)#
- add_adslab_info(num_adslabs: int, inference_list: list)#
Updates the Sankey dictionary with adslab information.
- Parameters
num_adslabs – the number of adslabs
num_inference – the number of inference calculations
- add_slab_info(num_unfiltered: int, num_filtered: int)#
Updates the Sankey dictionary with slab information.
- Parameters
num_unfiltered – the number of slabs prior to filtering
num_filtered – the number of slabs after filtering
- get_sankey_diagram(run_id: str, use_log=True)#
A function to create a pdf of the Sankey diagram.
- Parameters
run_id – unique id for the run to be used as a location for saving outputs
use_log (boolean, optional) – if the sankey flow values should be scaled
True. (logarithmically. Defaults to) –
- Returns
a pdf of the sankey diagram for the run
- update_dictionary(label: str, source: int, target: int, value: int, x: float, y)#
Updates the Sankey dictionary with a new edge (flow of content).
- Parameters
label – a new label to add to the labels
source – the node from which the flow comes
target – the node to which the flow goes
value – the magnitude of the flow
- update_y_positions(use_log)#
Update the y positions for all nodes at x = 1 so they are well spread out.
- Parameters
use_log – boolean value determining if the values will be log(values)