memory-graph 0.3.51__tar.gz → 0.3.53__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {memory_graph-0.3.51/memory_graph.egg-info → memory_graph-0.3.53}/PKG-INFO +18 -10
- {memory_graph-0.3.51 → memory_graph-0.3.53}/README.md +17 -9
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree.py +16 -17
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_mutable.py +1 -1
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/create_gif.sh +8 -1
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/create_images.sh +7 -4
- memory_graph-0.3.53/images/extension_pandas.png +0 -0
- memory_graph-0.3.53/images/hidden_edges.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/hidden_edges.py +1 -1
- memory_graph-0.3.53/images/many_types.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/__init__.py +10 -2
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/config.py +2 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/config_default.py +8 -5
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/memory_to_nodes.py +5 -1
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/node_linear.py +7 -2
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/slicer.py +1 -1
- {memory_graph-0.3.51 → memory_graph-0.3.53/memory_graph.egg-info}/PKG-INFO +18 -10
- memory_graph-0.3.53/memory_graph.egg-info/SOURCES.txt +111 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/pyproject.toml +1 -1
- memory_graph-0.3.51/images/-0 +0 -0
- memory_graph-0.3.51/images/add_one.gv +0 -69
- memory_graph-0.3.51/images/avltree_dir.gv +0 -57
- memory_graph-0.3.51/images/avltree_fail.gv +0 -22
- memory_graph-0.3.51/images/avltree_key_value.gv +0 -49
- memory_graph-0.3.51/images/avltree_leaf.gv +0 -22
- memory_graph-0.3.51/images/avltree_linear.gv +0 -57
- memory_graph-0.3.51/images/avltree_table.gv +0 -49
- memory_graph-0.3.51/images/bin_search.gv +0 -119
- memory_graph-0.3.51/images/bin_search_linear.gv +0 -133
- memory_graph-0.3.51/images/bin_tree.gv +0 -110
- memory_graph-0.3.51/images/binary0.gv +0 -22
- memory_graph-0.3.51/images/binary0.png +0 -0
- memory_graph-0.3.51/images/binary1.gv +0 -30
- memory_graph-0.3.51/images/binary1.png +0 -0
- memory_graph-0.3.51/images/binary10.gv +0 -62
- memory_graph-0.3.51/images/binary10.png +0 -0
- memory_graph-0.3.51/images/binary11.gv +0 -54
- memory_graph-0.3.51/images/binary11.png +0 -0
- memory_graph-0.3.51/images/binary12.gv +0 -46
- memory_graph-0.3.51/images/binary12.png +0 -0
- memory_graph-0.3.51/images/binary13.gv +0 -38
- memory_graph-0.3.51/images/binary13.png +0 -0
- memory_graph-0.3.51/images/binary14.gv +0 -30
- memory_graph-0.3.51/images/binary14.png +0 -0
- memory_graph-0.3.51/images/binary2.gv +0 -38
- memory_graph-0.3.51/images/binary2.png +0 -0
- memory_graph-0.3.51/images/binary3.gv +0 -46
- memory_graph-0.3.51/images/binary3.png +0 -0
- memory_graph-0.3.51/images/binary4.gv +0 -54
- memory_graph-0.3.51/images/binary4.png +0 -0
- memory_graph-0.3.51/images/binary5.gv +0 -62
- memory_graph-0.3.51/images/binary5.png +0 -0
- memory_graph-0.3.51/images/binary6.gv +0 -70
- memory_graph-0.3.51/images/binary6.png +0 -0
- memory_graph-0.3.51/images/binary7.gv +0 -78
- memory_graph-0.3.51/images/binary7.png +0 -0
- memory_graph-0.3.51/images/binary8.gv +0 -78
- memory_graph-0.3.51/images/binary8.png +0 -0
- memory_graph-0.3.51/images/binary9.gv +0 -70
- memory_graph-0.3.51/images/binary9.png +0 -0
- memory_graph-0.3.51/images/copies.gv +0 -63
- memory_graph-0.3.51/images/copies.png +0 -0
- memory_graph-0.3.51/images/copies_immutable.gv +0 -34
- memory_graph-0.3.51/images/copies_immutable.png +0 -0
- memory_graph-0.3.51/images/copies_mix.gv +0 -49
- memory_graph-0.3.51/images/copies_mix.png +0 -0
- memory_graph-0.3.51/images/copy_immutable.gv +0 -34
- memory_graph-0.3.51/images/copy_method.gv +0 -53
- memory_graph-0.3.51/images/copy_mix.gv +0 -49
- memory_graph-0.3.51/images/debug.gv +0 -15
- memory_graph-0.3.51/images/debugging0.gv +0 -29
- memory_graph-0.3.51/images/debugging0.png +0 -0
- memory_graph-0.3.51/images/debugging01.gv +0 -29
- memory_graph-0.3.51/images/debugging02.gv +0 -38
- memory_graph-0.3.51/images/debugging03.gv +0 -47
- memory_graph-0.3.51/images/debugging04.gv +0 -57
- memory_graph-0.3.51/images/debugging05.gv +0 -68
- memory_graph-0.3.51/images/debugging06.gv +0 -68
- memory_graph-0.3.51/images/debugging1.gv +0 -38
- memory_graph-0.3.51/images/debugging1.png +0 -0
- memory_graph-0.3.51/images/debugging2.gv +0 -47
- memory_graph-0.3.51/images/debugging2.png +0 -0
- memory_graph-0.3.51/images/debugging3.gv +0 -57
- memory_graph-0.3.51/images/debugging3.png +0 -0
- memory_graph-0.3.51/images/debugging4.gv +0 -68
- memory_graph-0.3.51/images/debugging4.png +0 -0
- memory_graph-0.3.51/images/debugging5.gv +0 -68
- memory_graph-0.3.51/images/debugging5.png +0 -0
- memory_graph-0.3.51/images/depth.gv +0 -178
- memory_graph-0.3.51/images/depth.png +0 -0
- memory_graph-0.3.51/images/embedded1.gv +0 -26
- memory_graph-0.3.51/images/embedded2.gv +0 -46
- memory_graph-0.3.51/images/extension_numpy.gv +0 -64
- memory_graph-0.3.51/images/extension_pandas.gv +0 -49
- memory_graph-0.3.51/images/extension_pandas.png +0 -0
- memory_graph-0.3.51/images/extension_torch.gv +0 -51
- memory_graph-0.3.51/images/factorial0.gv +0 -15
- memory_graph-0.3.51/images/factorial0.png +0 -0
- memory_graph-0.3.51/images/factorial01.gv +0 -15
- memory_graph-0.3.51/images/factorial02.gv +0 -22
- memory_graph-0.3.51/images/factorial03.gv +0 -28
- memory_graph-0.3.51/images/factorial04.gv +0 -34
- memory_graph-0.3.51/images/factorial05.gv +0 -35
- memory_graph-0.3.51/images/factorial06.gv +0 -29
- memory_graph-0.3.51/images/factorial07.gv +0 -23
- memory_graph-0.3.51/images/factorial1.gv +0 -22
- memory_graph-0.3.51/images/factorial1.png +0 -0
- memory_graph-0.3.51/images/factorial2.gv +0 -28
- memory_graph-0.3.51/images/factorial2.png +0 -0
- memory_graph-0.3.51/images/factorial3.gv +0 -34
- memory_graph-0.3.51/images/factorial3.png +0 -0
- memory_graph-0.3.51/images/factorial4.gv +0 -40
- memory_graph-0.3.51/images/factorial4.png +0 -0
- memory_graph-0.3.51/images/factorial5.gv +0 -46
- memory_graph-0.3.51/images/factorial5.png +0 -0
- memory_graph-0.3.51/images/factorial6.gv +0 -41
- memory_graph-0.3.51/images/factorial6.png +0 -0
- memory_graph-0.3.51/images/factorial7.gv +0 -35
- memory_graph-0.3.51/images/factorial7.png +0 -0
- memory_graph-0.3.51/images/factorial8.gv +0 -29
- memory_graph-0.3.51/images/factorial8.png +0 -0
- memory_graph-0.3.51/images/factorial9.gv +0 -23
- memory_graph-0.3.51/images/factorial9.png +0 -0
- memory_graph-0.3.51/images/hash_set.gv +0 -96
- memory_graph-0.3.51/images/hidden_edges.gv +0 -37
- memory_graph-0.3.51/images/hidden_edges.png +0 -0
- memory_graph-0.3.51/images/hidden_edges2.png +0 -0
- memory_graph-0.3.51/images/highlight.gv +0 -92
- memory_graph-0.3.51/images/immutable1.gv +0 -18
- memory_graph-0.3.51/images/immutable2.gv +0 -27
- memory_graph-0.3.51/images/introspect_depth.gv +0 -178
- memory_graph-0.3.51/images/linked_list.gv +0 -57
- memory_graph-0.3.51/images/many_types.gv +0 -46
- memory_graph-0.3.51/images/many_types.png +0 -0
- memory_graph-0.3.51/images/memory_graph.gv +0 -72
- memory_graph-0.3.51/images/memory_graph.gv.pdf +0 -0
- memory_graph-0.3.51/images/mutable1.gv +0 -18
- memory_graph-0.3.51/images/mutable2.gv +0 -19
- memory_graph-0.3.51/images/my_graph.gv +0 -31
- memory_graph-0.3.51/images/not_node_types1.gv +0 -26
- memory_graph-0.3.51/images/not_node_types2.gv +0 -46
- memory_graph-0.3.51/images/power_set0.gv +0 -38
- memory_graph-0.3.51/images/power_set0.png +0 -0
- memory_graph-0.3.51/images/power_set1.gv +0 -53
- memory_graph-0.3.51/images/power_set1.png +0 -0
- memory_graph-0.3.51/images/power_set10.gv +0 -103
- memory_graph-0.3.51/images/power_set10.png +0 -0
- memory_graph-0.3.51/images/power_set11.gv +0 -93
- memory_graph-0.3.51/images/power_set11.png +0 -0
- memory_graph-0.3.51/images/power_set12.gv +0 -93
- memory_graph-0.3.51/images/power_set12.png +0 -0
- memory_graph-0.3.51/images/power_set13.gv +0 -103
- memory_graph-0.3.51/images/power_set13.png +0 -0
- memory_graph-0.3.51/images/power_set14.gv +0 -114
- memory_graph-0.3.51/images/power_set14.png +0 -0
- memory_graph-0.3.51/images/power_set15.gv +0 -120
- memory_graph-0.3.51/images/power_set15.png +0 -0
- memory_graph-0.3.51/images/power_set16.gv +0 -116
- memory_graph-0.3.51/images/power_set16.png +0 -0
- memory_graph-0.3.51/images/power_set17.gv +0 -116
- memory_graph-0.3.51/images/power_set17.png +0 -0
- memory_graph-0.3.51/images/power_set18.gv +0 -126
- memory_graph-0.3.51/images/power_set18.png +0 -0
- memory_graph-0.3.51/images/power_set19.gv +0 -132
- memory_graph-0.3.51/images/power_set19.png +0 -0
- memory_graph-0.3.51/images/power_set2.gv +0 -63
- memory_graph-0.3.51/images/power_set2.png +0 -0
- memory_graph-0.3.51/images/power_set20.gv +0 -128
- memory_graph-0.3.51/images/power_set20.png +0 -0
- memory_graph-0.3.51/images/power_set21.gv +0 -118
- memory_graph-0.3.51/images/power_set21.png +0 -0
- memory_graph-0.3.51/images/power_set22.gv +0 -108
- memory_graph-0.3.51/images/power_set22.png +0 -0
- memory_graph-0.3.51/images/power_set23.gv +0 -93
- memory_graph-0.3.51/images/power_set23.png +0 -0
- memory_graph-0.3.51/images/power_set3.gv +0 -74
- memory_graph-0.3.51/images/power_set3.png +0 -0
- memory_graph-0.3.51/images/power_set4.gv +0 -85
- memory_graph-0.3.51/images/power_set4.png +0 -0
- memory_graph-0.3.51/images/power_set5.gv +0 -93
- memory_graph-0.3.51/images/power_set5.png +0 -0
- memory_graph-0.3.51/images/power_set6.gv +0 -91
- memory_graph-0.3.51/images/power_set6.png +0 -0
- memory_graph-0.3.51/images/power_set7.gv +0 -90
- memory_graph-0.3.51/images/power_set7.png +0 -0
- memory_graph-0.3.51/images/power_set8.gv +0 -101
- memory_graph-0.3.51/images/power_set8.png +0 -0
- memory_graph-0.3.51/images/power_set9.gv +0 -107
- memory_graph-0.3.51/images/power_set9.png +0 -0
- memory_graph-0.3.51/images/rebinding1.gv +0 -18
- memory_graph-0.3.51/images/rebinding2.gv +0 -26
- memory_graph-0.3.51/memory_graph/pytorch_test.py +0 -10
- memory_graph-0.3.51/memory_graph.egg-info/SOURCES.txt +0 -281
- {memory_graph-0.3.51 → memory_graph-0.3.53}/LICENSE.txt +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/MANIFEST.in +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/add_one.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/add_one.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree_dir.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree_fail.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree_key_value.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree_leaf.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree_linear.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/avltree_table.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/bin_search.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/bin_search.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/bin_search_linear.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/bin_tree.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/bin_tree.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/bin_tree.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/binary.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/binary.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/colab_example.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_immutable.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_immutable.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_method.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_method.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_mix.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_mix.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/copy_mutable.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/debug_vscode.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/debugging.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/debugging.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/embedded1.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/embedded2.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/extension_numpy.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/extension_numpy.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/extension_pandas.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/extension_torch.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/extension_torch.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/factorial.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/factorial.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/hash_set.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/hash_set.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/hash_set.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/immutable.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/immutable1.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/immutable2.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/introspect_depth.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/introspect_depth.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/ipython.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/jupyter_example.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/linked_list.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/linked_list.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/linked_list.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/many_types.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/marimo_example.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/memory_graph_web_debugger.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/mutable.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/mutable1.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/mutable2.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/name_rebinding.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/not_node_types.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/power_set.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/power_set.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/rebinding1.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/rebinding2.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/uva.png +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/images/vscode_copying.gif +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/call_stack.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/config_helpers.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/extension_numpy.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/extension_pandas.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/extension_torch.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/html_table.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/list_view.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/node_base.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/node_key_value.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/node_leaf.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/node_table.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/sequence.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/slices.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/slices_iterator.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/slices_table_iterator.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_max_graph_depth.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_memory_graph.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_memory_to_nodes.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_sequence.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_slicer.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_slices.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/test_slices_iterator.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph/utils.py +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph.egg-info/dependency_links.txt +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph.egg-info/requires.txt +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/memory_graph.egg-info/top_level.txt +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/setup.cfg +0 -0
- {memory_graph-0.3.51 → memory_graph-0.3.53}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memory_graph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.53
|
|
4
4
|
Summary: Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
|
|
5
5
|
Author-email: Bas Terwijn <bterwijn@gmail.com>
|
|
6
6
|
License: BSD 2-Clause License
|
|
@@ -52,7 +52,7 @@ Additionally [Graphviz](https://graphviz.org/download/) needs to be installed.
|
|
|
52
52
|
|
|
53
53
|
# Highlights #
|
|
54
54
|

|
|
55
|
-
|
|
55
|
+
Run a live demo in the 👉 [**Memory Graph Web Debugger**](https://memory-graph.com/#play) 👈 now, no installation required!
|
|
56
56
|
|
|
57
57
|
- learn the right **mental model** to think about Python data (references, mutability, shallow vs deep copy)
|
|
58
58
|
- **visualize the structure of your data** to easily understand and debug any data structure
|
|
@@ -553,6 +553,8 @@ for i in range(n):
|
|
|
553
553
|
Here we show values being added to a Linked List in Cursor AI. When adding the last value '5' we "Step Into" the code to show more of the details.
|
|
554
554
|

|
|
555
555
|
|
|
556
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/linked_list.py×tep=0.2&play).
|
|
557
|
+
|
|
556
558
|
## Binary Tree ##
|
|
557
559
|
```python
|
|
558
560
|
import memory_graph as mg
|
|
@@ -593,6 +595,7 @@ for i in range(n):
|
|
|
593
595
|
Here we show values being inserted in a Binary Tree in Visual Studio Code. When inserting the last value '29' we "Step Into" the code to show the recursive implementation.
|
|
594
596
|

|
|
595
597
|
|
|
598
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/bin_tree.py×tep=0.2&play).
|
|
596
599
|
|
|
597
600
|
## Hash Set ##
|
|
598
601
|
```python
|
|
@@ -636,6 +639,8 @@ for i in range(n):
|
|
|
636
639
|
Here we show values being inserted in a HashSet in PyCharm. When inserting the last value '44' we "Step Into" the code to show more of the details.
|
|
637
640
|

|
|
638
641
|
|
|
642
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/hash_set.py×tep=0.2&play).
|
|
643
|
+
|
|
639
644
|
# Configuration #
|
|
640
645
|
Different aspects of memory_graph can be configured. The default configuration can be reset by calling 'mg.config_default.reset()'.
|
|
641
646
|
|
|
@@ -663,6 +668,9 @@ Different aspects of memory_graph can be configured. The default configuration c
|
|
|
663
668
|
- ***mg.config.embedding_types*** : set[type]
|
|
664
669
|
- Holds all dictionary types that embed their key-value tuple children.
|
|
665
670
|
|
|
671
|
+
- ***mg.config.no_index_types*** : set[type]
|
|
672
|
+
- Holds all types like 'set' and 'frozenset' that should not have indices as Node_Linear.
|
|
673
|
+
|
|
666
674
|
- ***mg.config.type_to_node*** : dict[type, fun(data) -> Node]
|
|
667
675
|
- Determines how a data type is converted to a Node subclass for visualization in the graph.
|
|
668
676
|
|
|
@@ -676,7 +684,7 @@ Different aspects of memory_graph can be configured. The default configuration c
|
|
|
676
684
|
- Maps a type to a Slicer. A slicer determines how many elements of a data type are shown in the graph to prevent the graph from getting too big. 'Slicer()' does no slicing, 'Slicer(1,2,3)' shows just 1 element at the beginning, 2 in the middle, and 3 at the end.
|
|
677
685
|
|
|
678
686
|
- ***mg.config.max_graph_depth*** : int
|
|
679
|
-
- The maxium depth of the graph with default value
|
|
687
|
+
- The maxium depth of the graph with default value 1000.
|
|
680
688
|
|
|
681
689
|
- ***mg.config.graph_cut_symbol*** : str
|
|
682
690
|
- The symbol indicating where the graph is cut short with default `✂`.
|
|
@@ -743,9 +751,9 @@ tree.insert(20, "twenty")
|
|
|
743
751
|
tree.insert(15, "fifteen")
|
|
744
752
|
|
|
745
753
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
746
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
754
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
747
755
|
dir(data))
|
|
748
|
-
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.
|
|
756
|
+
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.Slicer()
|
|
749
757
|
|
|
750
758
|
mg.show(locals())
|
|
751
759
|
```
|
|
@@ -767,7 +775,7 @@ tree.insert(20, "twenty")
|
|
|
767
775
|
tree.insert(15, "fifteen")
|
|
768
776
|
|
|
769
777
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
770
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
778
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Leaf(data,
|
|
771
779
|
f"key:{data.key} value:{data.value}")
|
|
772
780
|
|
|
773
781
|
mg.show(locals())
|
|
@@ -788,7 +796,7 @@ tree.insert(20, "twenty")
|
|
|
788
796
|
tree.insert(15, "fifteen")
|
|
789
797
|
|
|
790
798
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
791
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
799
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
792
800
|
['left:', data.left,
|
|
793
801
|
'key:', data.key,
|
|
794
802
|
'value:', data.value,
|
|
@@ -812,7 +820,7 @@ tree.insert(20, "twenty")
|
|
|
812
820
|
tree.insert(15, "fifteen")
|
|
813
821
|
|
|
814
822
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
815
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
823
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Key_Value(data,
|
|
816
824
|
{'left': data.left,
|
|
817
825
|
'key': data.key,
|
|
818
826
|
'value': data.value,
|
|
@@ -836,7 +844,7 @@ tree.insert(20, "twenty")
|
|
|
836
844
|
tree.insert(15, "fifteen")
|
|
837
845
|
|
|
838
846
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
839
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
847
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Table(data,
|
|
840
848
|
[[data.key, data.value],
|
|
841
849
|
[data.left, data.right]] )
|
|
842
850
|
|
|
@@ -891,7 +899,7 @@ Arguably the visualization is then more clear when we show a List_View object as
|
|
|
891
899
|
|
|
892
900
|
```python
|
|
893
901
|
mg.config.type_to_color[List_View] = 'hotpink'
|
|
894
|
-
mg.config.type_to_node[List_View] = lambda data: mg.
|
|
902
|
+
mg.config.type_to_node[List_View] = lambda data: mg.Node_Linear(data,
|
|
895
903
|
data.lst[data.begin:data.end])
|
|
896
904
|
```
|
|
897
905
|

|
|
@@ -7,7 +7,7 @@ Additionally [Graphviz](https://graphviz.org/download/) needs to be installed.
|
|
|
7
7
|
|
|
8
8
|
# Highlights #
|
|
9
9
|

|
|
10
|
-
|
|
10
|
+
Run a live demo in the 👉 [**Memory Graph Web Debugger**](https://memory-graph.com/#play) 👈 now, no installation required!
|
|
11
11
|
|
|
12
12
|
- learn the right **mental model** to think about Python data (references, mutability, shallow vs deep copy)
|
|
13
13
|
- **visualize the structure of your data** to easily understand and debug any data structure
|
|
@@ -508,6 +508,8 @@ for i in range(n):
|
|
|
508
508
|
Here we show values being added to a Linked List in Cursor AI. When adding the last value '5' we "Step Into" the code to show more of the details.
|
|
509
509
|

|
|
510
510
|
|
|
511
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/linked_list.py×tep=0.2&play).
|
|
512
|
+
|
|
511
513
|
## Binary Tree ##
|
|
512
514
|
```python
|
|
513
515
|
import memory_graph as mg
|
|
@@ -548,6 +550,7 @@ for i in range(n):
|
|
|
548
550
|
Here we show values being inserted in a Binary Tree in Visual Studio Code. When inserting the last value '29' we "Step Into" the code to show the recursive implementation.
|
|
549
551
|

|
|
550
552
|
|
|
553
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/bin_tree.py×tep=0.2&play).
|
|
551
554
|
|
|
552
555
|
## Hash Set ##
|
|
553
556
|
```python
|
|
@@ -591,6 +594,8 @@ for i in range(n):
|
|
|
591
594
|
Here we show values being inserted in a HashSet in PyCharm. When inserting the last value '44' we "Step Into" the code to show more of the details.
|
|
592
595
|

|
|
593
596
|
|
|
597
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/hash_set.py×tep=0.2&play).
|
|
598
|
+
|
|
594
599
|
# Configuration #
|
|
595
600
|
Different aspects of memory_graph can be configured. The default configuration can be reset by calling 'mg.config_default.reset()'.
|
|
596
601
|
|
|
@@ -618,6 +623,9 @@ Different aspects of memory_graph can be configured. The default configuration c
|
|
|
618
623
|
- ***mg.config.embedding_types*** : set[type]
|
|
619
624
|
- Holds all dictionary types that embed their key-value tuple children.
|
|
620
625
|
|
|
626
|
+
- ***mg.config.no_index_types*** : set[type]
|
|
627
|
+
- Holds all types like 'set' and 'frozenset' that should not have indices as Node_Linear.
|
|
628
|
+
|
|
621
629
|
- ***mg.config.type_to_node*** : dict[type, fun(data) -> Node]
|
|
622
630
|
- Determines how a data type is converted to a Node subclass for visualization in the graph.
|
|
623
631
|
|
|
@@ -631,7 +639,7 @@ Different aspects of memory_graph can be configured. The default configuration c
|
|
|
631
639
|
- Maps a type to a Slicer. A slicer determines how many elements of a data type are shown in the graph to prevent the graph from getting too big. 'Slicer()' does no slicing, 'Slicer(1,2,3)' shows just 1 element at the beginning, 2 in the middle, and 3 at the end.
|
|
632
640
|
|
|
633
641
|
- ***mg.config.max_graph_depth*** : int
|
|
634
|
-
- The maxium depth of the graph with default value
|
|
642
|
+
- The maxium depth of the graph with default value 1000.
|
|
635
643
|
|
|
636
644
|
- ***mg.config.graph_cut_symbol*** : str
|
|
637
645
|
- The symbol indicating where the graph is cut short with default `✂`.
|
|
@@ -698,9 +706,9 @@ tree.insert(20, "twenty")
|
|
|
698
706
|
tree.insert(15, "fifteen")
|
|
699
707
|
|
|
700
708
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
701
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
709
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
702
710
|
dir(data))
|
|
703
|
-
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.
|
|
711
|
+
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.Slicer()
|
|
704
712
|
|
|
705
713
|
mg.show(locals())
|
|
706
714
|
```
|
|
@@ -722,7 +730,7 @@ tree.insert(20, "twenty")
|
|
|
722
730
|
tree.insert(15, "fifteen")
|
|
723
731
|
|
|
724
732
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
725
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
733
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Leaf(data,
|
|
726
734
|
f"key:{data.key} value:{data.value}")
|
|
727
735
|
|
|
728
736
|
mg.show(locals())
|
|
@@ -743,7 +751,7 @@ tree.insert(20, "twenty")
|
|
|
743
751
|
tree.insert(15, "fifteen")
|
|
744
752
|
|
|
745
753
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
746
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
754
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
747
755
|
['left:', data.left,
|
|
748
756
|
'key:', data.key,
|
|
749
757
|
'value:', data.value,
|
|
@@ -767,7 +775,7 @@ tree.insert(20, "twenty")
|
|
|
767
775
|
tree.insert(15, "fifteen")
|
|
768
776
|
|
|
769
777
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
770
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
778
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Key_Value(data,
|
|
771
779
|
{'left': data.left,
|
|
772
780
|
'key': data.key,
|
|
773
781
|
'value': data.value,
|
|
@@ -791,7 +799,7 @@ tree.insert(20, "twenty")
|
|
|
791
799
|
tree.insert(15, "fifteen")
|
|
792
800
|
|
|
793
801
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
794
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
802
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Table(data,
|
|
795
803
|
[[data.key, data.value],
|
|
796
804
|
[data.left, data.right]] )
|
|
797
805
|
|
|
@@ -846,7 +854,7 @@ Arguably the visualization is then more clear when we show a List_View object as
|
|
|
846
854
|
|
|
847
855
|
```python
|
|
848
856
|
mg.config.type_to_color[List_View] = 'hotpink'
|
|
849
|
-
mg.config.type_to_node[List_View] = lambda data: mg.
|
|
857
|
+
mg.config.type_to_node[List_View] = lambda data: mg.Node_Linear(data,
|
|
850
858
|
data.lst[data.begin:data.end])
|
|
851
859
|
```
|
|
852
860
|

|
|
@@ -15,29 +15,28 @@ tree.insert(15, "fifteen")
|
|
|
15
15
|
# mg.render(locals(), 'avltree_fail.png') # id keeps changing
|
|
16
16
|
|
|
17
17
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
18
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
19
|
-
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.
|
|
18
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data, dir(data))
|
|
19
|
+
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.Slicer()
|
|
20
20
|
# mg.render(locals(), 'avltree_dir.png') # stuff changes
|
|
21
21
|
|
|
22
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
22
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Leaf(data, f"key:{data.key} value:{data.value}")
|
|
23
23
|
mg.render(locals(), 'avltree_leaf.png')
|
|
24
24
|
|
|
25
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
26
|
+
['left:', data.left,
|
|
27
|
+
'key:', data.key,
|
|
28
|
+
'value:', data.value,
|
|
29
|
+
'right:', data.right])
|
|
30
30
|
mg.render(locals(), 'avltree_linear.png')
|
|
31
31
|
|
|
32
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Key_Value(data,
|
|
33
|
+
{'left': data.left,
|
|
34
|
+
'key': data.key,
|
|
35
|
+
'value': data.value,
|
|
36
|
+
'right': data.right}.items())
|
|
37
37
|
mg.render(locals(), 'avltree_key_value.png')
|
|
38
38
|
|
|
39
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)
|
|
39
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Table(data,
|
|
40
|
+
[[data.key, data.value],
|
|
41
|
+
[data.left, data.right]])
|
|
43
42
|
mg.render(locals(), 'avltree_table.png')
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
# sudo apt install imagemagick
|
|
6
6
|
|
|
7
7
|
name="$1"
|
|
8
|
-
files=$(ls -v $name*.png)
|
|
8
|
+
files=$(ls -v $name*.png | tr '\n' ' ')
|
|
9
|
+
files_gv=$(ls -v $name*.gv | tr '\n' ' ')
|
|
9
10
|
echo "creating gif with:"
|
|
10
11
|
echo "$files"
|
|
11
12
|
|
|
@@ -17,4 +18,10 @@ mogrify -resize $largest_size -background white -gravity center -extent $largest
|
|
|
17
18
|
|
|
18
19
|
echo "creating file: $name.gif"
|
|
19
20
|
convert -delay 150 -dither None -loop 0 $files $name.gif
|
|
21
|
+
|
|
22
|
+
if [ "$2" = "-d" ]; then
|
|
23
|
+
echo "deleting: $files $files_gv"
|
|
24
|
+
rm $files $files_gv
|
|
25
|
+
fi
|
|
26
|
+
|
|
20
27
|
echo "done"
|
|
@@ -3,7 +3,7 @@ python many_types.py
|
|
|
3
3
|
|
|
4
4
|
# debugging
|
|
5
5
|
python debugging.py
|
|
6
|
-
bash create_gif.sh debugging
|
|
6
|
+
bash create_gif.sh debugging -d
|
|
7
7
|
|
|
8
8
|
# data model
|
|
9
9
|
python immutable.py
|
|
@@ -17,11 +17,11 @@ python name_rebinding.py
|
|
|
17
17
|
# call stack
|
|
18
18
|
python add_one.py
|
|
19
19
|
python factorial.py
|
|
20
|
-
bash create_gif.sh factorial
|
|
20
|
+
bash create_gif.sh factorial -d
|
|
21
21
|
python binary.py
|
|
22
|
-
bash create_gif.sh binary
|
|
22
|
+
bash create_gif.sh binary -d
|
|
23
23
|
python power_set.py
|
|
24
|
-
bash create_gif.sh power_set
|
|
24
|
+
bash create_gif.sh power_set -d
|
|
25
25
|
|
|
26
26
|
# datastructures
|
|
27
27
|
python linked_list.py
|
|
@@ -40,3 +40,6 @@ python hidden_edges.py
|
|
|
40
40
|
# extensions
|
|
41
41
|
python extension_numpy.py
|
|
42
42
|
python extension_pandas.py
|
|
43
|
+
|
|
44
|
+
# clean up the graphviz files
|
|
45
|
+
rm *.gv
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Copyright (c) 2023, Bas Terwijn.
|
|
3
3
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
4
4
|
|
|
5
|
+
__version__ = "0.3.53"
|
|
6
|
+
__author__ = 'Bas Terwijn'
|
|
7
|
+
|
|
5
8
|
import memory_graph.memory_to_nodes as memory_to_nodes
|
|
6
9
|
import memory_graph.config as config
|
|
7
10
|
import memory_graph.config_default
|
|
@@ -21,8 +24,13 @@ import builtins
|
|
|
21
24
|
if not hasattr(builtins, "mg"):
|
|
22
25
|
builtins.mg = mg
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
# re-exports for shorter names
|
|
28
|
+
from .slicer import Slicer
|
|
29
|
+
from .node_leaf import Node_Leaf
|
|
30
|
+
from .node_linear import Node_Linear
|
|
31
|
+
from .node_key_value import Node_Key_Value
|
|
32
|
+
from .node_table import Node_Table
|
|
33
|
+
|
|
26
34
|
|
|
27
35
|
last_show_filename = None
|
|
28
36
|
render_filename_count = 0
|
|
@@ -52,7 +52,10 @@ def reset():
|
|
|
52
52
|
""" Types that will embed their children. """
|
|
53
53
|
config.embedding_types = {dict, types.MappingProxyType}
|
|
54
54
|
|
|
55
|
-
""" Types that
|
|
55
|
+
""" Types that should not show an index """
|
|
56
|
+
config.no_index_types = {set, frozenset}
|
|
57
|
+
|
|
58
|
+
""" Types that need a special conversion """
|
|
56
59
|
config.type_to_string = {
|
|
57
60
|
types.FunctionType: lambda data: data.__qualname__,
|
|
58
61
|
types.MethodType: lambda data: data.__qualname__,
|
|
@@ -107,13 +110,13 @@ def reset():
|
|
|
107
110
|
|
|
108
111
|
""" Slicer objects for different types. """
|
|
109
112
|
config.type_to_slicer = {
|
|
110
|
-
Node_Linear: Slicer(5,
|
|
111
|
-
Node_Key_Value: Slicer(5,
|
|
112
|
-
Node_Table: (Slicer(3,2,3), Slicer(3,2,3)),
|
|
113
|
+
Node_Linear: Slicer(10, 5, 10),
|
|
114
|
+
Node_Key_Value: Slicer(10, 5, 10),
|
|
115
|
+
Node_Table: (Slicer(3, 2, 3), Slicer(3, 2, 3)),
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
""" The maximum depth of nodes in the graph. When the graph gets too big set this to a small positive number. A `✂` symbol indictes where the graph is cut short. """
|
|
116
|
-
config.max_graph_depth =
|
|
119
|
+
config.max_graph_depth = 1000
|
|
117
120
|
config.graph_cut_symbol = '✂'
|
|
118
121
|
|
|
119
122
|
|
|
@@ -149,8 +149,12 @@ def add_missing_edges(nodes, id_to_slices, max_missing_edges=3):
|
|
|
149
149
|
for index in indices:
|
|
150
150
|
if parent_slices is None or not parent_slices.has_index(index):
|
|
151
151
|
type_to_parent_indices.setdefault(parent_type, [])
|
|
152
|
+
#if not parent_type in type_to_parent_indices:
|
|
153
|
+
# type_to_parent_indices[parent_type] = []
|
|
152
154
|
parent_indices = type_to_parent_indices[parent_type]
|
|
153
|
-
if len(parent_indices)
|
|
155
|
+
if len(parent_indices) > max_missing_edges:
|
|
156
|
+
break
|
|
157
|
+
else:
|
|
154
158
|
parent_indices.append((parent, index))
|
|
155
159
|
add_parent_indices(nodes, type_to_parent_indices, id_to_slices, max_missing_edges)
|
|
156
160
|
|
|
@@ -6,6 +6,7 @@ from memory_graph.node_base import Node_Base
|
|
|
6
6
|
from memory_graph.sequence import Sequence1D
|
|
7
7
|
|
|
8
8
|
import memory_graph.config_helpers as config_helpers
|
|
9
|
+
import memory_graph.config as config
|
|
9
10
|
|
|
10
11
|
class Node_Linear(Node_Base):
|
|
11
12
|
"""
|
|
@@ -56,9 +57,11 @@ class Node_Linear(Node_Base):
|
|
|
56
57
|
"""
|
|
57
58
|
Helper function to fill the html_table with the children of the Node_Base in vertical orientation.
|
|
58
59
|
"""
|
|
60
|
+
show_index = not self.get_type() in config.no_index_types
|
|
59
61
|
for index in slices.table_iter(self.children.size()):
|
|
60
62
|
if index>=0:
|
|
61
|
-
|
|
63
|
+
if show_index:
|
|
64
|
+
html_table.add_index(index)
|
|
62
65
|
child = self.children[index]
|
|
63
66
|
html_table.add_entry(self, nodes, child, id_to_slices, dashed=slices.is_dashed(index))
|
|
64
67
|
html_table.add_new_line()
|
|
@@ -71,9 +74,11 @@ class Node_Linear(Node_Base):
|
|
|
71
74
|
"""
|
|
72
75
|
Helper function to fill the html_table with the children of the Node_Base in horizontal orientation.
|
|
73
76
|
"""
|
|
77
|
+
show_index = not self.get_type() in config.no_index_types
|
|
74
78
|
for index in slices.table_iter(self.children.size()):
|
|
75
79
|
if index>=0:
|
|
76
|
-
|
|
80
|
+
if show_index:
|
|
81
|
+
html_table.add_index(index)
|
|
77
82
|
else:
|
|
78
83
|
html_table.add_value('', border=0)
|
|
79
84
|
html_table.add_new_line()
|
|
@@ -15,7 +15,7 @@ class Slicer:
|
|
|
15
15
|
self.end, self.middle = self.middle, self.end
|
|
16
16
|
|
|
17
17
|
def __repr__(self) -> str:
|
|
18
|
-
return f"Slicer({self.begin},{self.middle},{self.end})"
|
|
18
|
+
return f"Slicer({self.begin}, {self.middle}, {self.end})"
|
|
19
19
|
|
|
20
20
|
def get_slices(self, length):
|
|
21
21
|
slices1d = Slices1D()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memory_graph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.53
|
|
4
4
|
Summary: Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
|
|
5
5
|
Author-email: Bas Terwijn <bterwijn@gmail.com>
|
|
6
6
|
License: BSD 2-Clause License
|
|
@@ -52,7 +52,7 @@ Additionally [Graphviz](https://graphviz.org/download/) needs to be installed.
|
|
|
52
52
|
|
|
53
53
|
# Highlights #
|
|
54
54
|

|
|
55
|
-
|
|
55
|
+
Run a live demo in the 👉 [**Memory Graph Web Debugger**](https://memory-graph.com/#play) 👈 now, no installation required!
|
|
56
56
|
|
|
57
57
|
- learn the right **mental model** to think about Python data (references, mutability, shallow vs deep copy)
|
|
58
58
|
- **visualize the structure of your data** to easily understand and debug any data structure
|
|
@@ -553,6 +553,8 @@ for i in range(n):
|
|
|
553
553
|
Here we show values being added to a Linked List in Cursor AI. When adding the last value '5' we "Step Into" the code to show more of the details.
|
|
554
554
|

|
|
555
555
|
|
|
556
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/linked_list.py×tep=0.2&play).
|
|
557
|
+
|
|
556
558
|
## Binary Tree ##
|
|
557
559
|
```python
|
|
558
560
|
import memory_graph as mg
|
|
@@ -593,6 +595,7 @@ for i in range(n):
|
|
|
593
595
|
Here we show values being inserted in a Binary Tree in Visual Studio Code. When inserting the last value '29' we "Step Into" the code to show the recursive implementation.
|
|
594
596
|

|
|
595
597
|
|
|
598
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/bin_tree.py×tep=0.2&play).
|
|
596
599
|
|
|
597
600
|
## Hash Set ##
|
|
598
601
|
```python
|
|
@@ -636,6 +639,8 @@ for i in range(n):
|
|
|
636
639
|
Here we show values being inserted in a HashSet in PyCharm. When inserting the last value '44' we "Step Into" the code to show more of the details.
|
|
637
640
|

|
|
638
641
|
|
|
642
|
+
Or see it in the [Memory Grah Web Debugger](https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/hash_set.py×tep=0.2&play).
|
|
643
|
+
|
|
639
644
|
# Configuration #
|
|
640
645
|
Different aspects of memory_graph can be configured. The default configuration can be reset by calling 'mg.config_default.reset()'.
|
|
641
646
|
|
|
@@ -663,6 +668,9 @@ Different aspects of memory_graph can be configured. The default configuration c
|
|
|
663
668
|
- ***mg.config.embedding_types*** : set[type]
|
|
664
669
|
- Holds all dictionary types that embed their key-value tuple children.
|
|
665
670
|
|
|
671
|
+
- ***mg.config.no_index_types*** : set[type]
|
|
672
|
+
- Holds all types like 'set' and 'frozenset' that should not have indices as Node_Linear.
|
|
673
|
+
|
|
666
674
|
- ***mg.config.type_to_node*** : dict[type, fun(data) -> Node]
|
|
667
675
|
- Determines how a data type is converted to a Node subclass for visualization in the graph.
|
|
668
676
|
|
|
@@ -676,7 +684,7 @@ Different aspects of memory_graph can be configured. The default configuration c
|
|
|
676
684
|
- Maps a type to a Slicer. A slicer determines how many elements of a data type are shown in the graph to prevent the graph from getting too big. 'Slicer()' does no slicing, 'Slicer(1,2,3)' shows just 1 element at the beginning, 2 in the middle, and 3 at the end.
|
|
677
685
|
|
|
678
686
|
- ***mg.config.max_graph_depth*** : int
|
|
679
|
-
- The maxium depth of the graph with default value
|
|
687
|
+
- The maxium depth of the graph with default value 1000.
|
|
680
688
|
|
|
681
689
|
- ***mg.config.graph_cut_symbol*** : str
|
|
682
690
|
- The symbol indicating where the graph is cut short with default `✂`.
|
|
@@ -743,9 +751,9 @@ tree.insert(20, "twenty")
|
|
|
743
751
|
tree.insert(15, "fifteen")
|
|
744
752
|
|
|
745
753
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
746
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
754
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
747
755
|
dir(data))
|
|
748
|
-
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.
|
|
756
|
+
mg.config.type_to_slicer[bintrees.avltree.Node] = mg.Slicer()
|
|
749
757
|
|
|
750
758
|
mg.show(locals())
|
|
751
759
|
```
|
|
@@ -767,7 +775,7 @@ tree.insert(20, "twenty")
|
|
|
767
775
|
tree.insert(15, "fifteen")
|
|
768
776
|
|
|
769
777
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
770
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
778
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Leaf(data,
|
|
771
779
|
f"key:{data.key} value:{data.value}")
|
|
772
780
|
|
|
773
781
|
mg.show(locals())
|
|
@@ -788,7 +796,7 @@ tree.insert(20, "twenty")
|
|
|
788
796
|
tree.insert(15, "fifteen")
|
|
789
797
|
|
|
790
798
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
791
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
799
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Linear(data,
|
|
792
800
|
['left:', data.left,
|
|
793
801
|
'key:', data.key,
|
|
794
802
|
'value:', data.value,
|
|
@@ -812,7 +820,7 @@ tree.insert(20, "twenty")
|
|
|
812
820
|
tree.insert(15, "fifteen")
|
|
813
821
|
|
|
814
822
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
815
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
823
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Key_Value(data,
|
|
816
824
|
{'left': data.left,
|
|
817
825
|
'key': data.key,
|
|
818
826
|
'value': data.value,
|
|
@@ -836,7 +844,7 @@ tree.insert(20, "twenty")
|
|
|
836
844
|
tree.insert(15, "fifteen")
|
|
837
845
|
|
|
838
846
|
mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
|
|
839
|
-
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.
|
|
847
|
+
mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.Node_Table(data,
|
|
840
848
|
[[data.key, data.value],
|
|
841
849
|
[data.left, data.right]] )
|
|
842
850
|
|
|
@@ -891,7 +899,7 @@ Arguably the visualization is then more clear when we show a List_View object as
|
|
|
891
899
|
|
|
892
900
|
```python
|
|
893
901
|
mg.config.type_to_color[List_View] = 'hotpink'
|
|
894
|
-
mg.config.type_to_node[List_View] = lambda data: mg.
|
|
902
|
+
mg.config.type_to_node[List_View] = lambda data: mg.Node_Linear(data,
|
|
895
903
|
data.lst[data.begin:data.end])
|
|
896
904
|
```
|
|
897
905
|

|