Dictionary module¶
This module contains the functionality to visualize a dictionary data structure as it changes throughout a function. This involves the following classes: * TrackedDict(dict): detects changes made to a given dictionary
data structure and triggers creation of a new visualization for each change.
Dict: uses graphviz to construct a visualization of the dictionary using a table.
- class seealgo.see_dict_algo.Dict¶
Create graphviz visualization for dictionary data structure
- create_viz(data, keys=None)¶
Creates and renders a visualization of the dictionary using graphviz Args:
data (dict): dictionary that is being visualized key (iterable): optional list of keys of new key-value pairs
- see(func, data)¶
Creates a visualization for the initial dictionary and starts tracking a given dictionary as it changes throughout a given function. Args:
func (function): function that the dictionary is being altered through data (dict): dictionary to track
- class seealgo.see_dict_algo.TrackedDict¶
Tracks changes to a dictionary data structure and triggers creation of new visualization Args:
dict: the dictionary data structure to track
- pop(key)¶
Removes a key-value pair given the key. Args:
key (Any): key of the key-value pair to be removed
- Raises:
KeyError: If the element to be removed is not in the dictionary.
- update(iterable)¶
Sets the value of a key-value pair and checks the keys of the dictionary Args:
key (Any): key of the key-value pair to be set value (Any): value to be set for the specified key