memory-graph 0.3.54__tar.gz → 0.3.55__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.54/memory_graph.egg-info → memory_graph-0.3.55}/PKG-INFO +14 -8
- {memory_graph-0.3.54 → memory_graph-0.3.55}/README.md +13 -7
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/__init__.py +1 -1
- {memory_graph-0.3.54 → memory_graph-0.3.55/memory_graph.egg-info}/PKG-INFO +14 -8
- {memory_graph-0.3.54 → memory_graph-0.3.55}/pyproject.toml +1 -1
- {memory_graph-0.3.54 → memory_graph-0.3.55}/LICENSE.txt +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/MANIFEST.in +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/add_one.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/add_one.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree_dir.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree_fail.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree_key_value.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree_leaf.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree_linear.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/avltree_table.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/bin_search.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/bin_search.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/bin_search_linear.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/bin_tree.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/bin_tree.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/bin_tree.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/binary.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/binary.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/colab_example.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_immutable.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_immutable.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_method.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_method.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_mix.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_mix.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_mutable.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/copy_mutable.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/create_gif.sh +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/create_images.sh +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/debug_vscode.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/debugging.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/debugging.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/embedded1.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/embedded2.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/extension_numpy.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/extension_numpy.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/extension_pandas.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/extension_pandas.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/extension_torch.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/extension_torch.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/factorial.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/factorial.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/hash_set.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/hash_set.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/hash_set.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/hidden_edges.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/hidden_edges.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/immutable.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/immutable1.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/immutable2.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/introspect_depth.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/introspect_depth.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/ipython.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/jupyter_example.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/linked_list.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/linked_list.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/linked_list.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/many_types.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/many_types.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/marimo_example.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/memory_graph_web_debugger.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/mutable.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/mutable1.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/mutable2.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/name_rebinding.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/not_node_types.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/power_set.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/power_set.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/rebinding1.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/rebinding2.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/uva.png +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/images/vscode_copying.gif +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/call_stack.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/config.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/config_default.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/config_helpers.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/extension_numpy.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/extension_pandas.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/extension_torch.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/html_table.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/list_view.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/memory_to_nodes.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/node_base.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/node_key_value.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/node_leaf.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/node_linear.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/node_table.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/sequence.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/slicer.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/slices.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/slices_iterator.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/slices_table_iterator.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_max_graph_depth.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_memory_graph.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_memory_to_nodes.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_sequence.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_slicer.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_slices.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/test_slices_iterator.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph/utils.py +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph.egg-info/SOURCES.txt +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph.egg-info/dependency_links.txt +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph.egg-info/requires.txt +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/memory_graph.egg-info/top_level.txt +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/setup.cfg +0 -0
- {memory_graph-0.3.54 → memory_graph-0.3.55}/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.55
|
|
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
|
|
@@ -58,6 +58,10 @@ Run a live demo in the 👉 [**Memory Graph Web Debugger**](https://memory-graph
|
|
|
58
58
|
- **visualize the structure of your data** to easily understand and debug any data structure
|
|
59
59
|
- understand function calls, variable scope, and the **complete program state** through call stack visualization
|
|
60
60
|
|
|
61
|
+
An example Binary Tree data structure:
|
|
62
|
+

|
|
63
|
+
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).
|
|
64
|
+
|
|
61
65
|
# Videos #
|
|
62
66
|
| [](https://www.youtube.com/watch?v=23_bHcr7hqo) | [](https://www.youtube.com/watch?v=pvIJgHCaXhU) |
|
|
63
67
|
|:--:|:--:|
|
|
@@ -132,7 +136,7 @@ identical?: True
|
|
|
132
136
|
```
|
|
133
137
|
A better way to understand what values are shared is to draw a graph using [memory_graph](https://pypi.org/project/memory-graph/).
|
|
134
138
|
|
|
135
|
-
#
|
|
139
|
+
# Topics #
|
|
136
140
|
|
|
137
141
|
[Python Data Model](#python-data-model)
|
|
138
142
|
|
|
@@ -173,8 +177,8 @@ Bas Terwijn
|
|
|
173
177
|
Inspired by [Python Tutor](https://pythontutor.com/).
|
|
174
178
|
|
|
175
179
|
## Social Media #
|
|
176
|
-
* LinkedIn
|
|
177
|
-
* Reddit
|
|
180
|
+
* [LinkedIn](https://www.linkedin.com/groups/13244150/)
|
|
181
|
+
* [Reddit](https://www.reddit.com/r/Python_memory_graph/)
|
|
178
182
|
|
|
179
183
|
## Supported by ##
|
|
180
184
|
<img src="https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/uva.png" alt="University of Amsterdam" width="600">
|
|
@@ -398,8 +402,8 @@ and the result is: 1 x 2 x 3 x 4 = 24
|
|
|
398
402
|
|
|
399
403
|
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/factorial.py×tep=1.0&play).
|
|
400
404
|
|
|
401
|
-
## Binary
|
|
402
|
-
A more interesting recursive example is function `binary()` that converts a decimal
|
|
405
|
+
## Binary Conversion ##
|
|
406
|
+
A more interesting recursive example is function `binary()` that converts a integer from decimal to binary representation.
|
|
403
407
|
```python
|
|
404
408
|
import memory_graph as mg
|
|
405
409
|
mg.config.type_to_horizontal[list] = True # horizontal lists
|
|
@@ -417,7 +421,7 @@ print( binary(100) )
|
|
|
417
421
|
```
|
|
418
422
|

|
|
419
423
|
```
|
|
420
|
-
|
|
424
|
+
[1, 1, 0, 0, 1, 0, 0]
|
|
421
425
|
```
|
|
422
426
|
|
|
423
427
|
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/binary_convert.py×tep=1.0&play).
|
|
@@ -452,6 +456,8 @@ print( power_set(['a', 'b', 'c']) )
|
|
|
452
456
|
[['a', 'b', 'c'], ['a', 'b'], ['a', 'c'], ['a'], ['b', 'c'], ['b'], ['c'], []]
|
|
453
457
|
```
|
|
454
458
|
|
|
459
|
+
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/power_set.py×tep=1.0&play).
|
|
460
|
+
|
|
455
461
|
# Debugging #
|
|
456
462
|
|
|
457
463
|
For the best debugging experience with memory_graph set for example expression:
|
|
@@ -1101,7 +1107,7 @@ $ bash create_gif.sh animated
|
|
|
1101
1107
|
```
|
|
1102
1108
|
|
|
1103
1109
|
# Troubleshooting #
|
|
1104
|
-
- Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open '
|
|
1110
|
+
- Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open 'memory_graph.pdf' for writing : Permission denied` error. One solution is to install a PDF reader that does refresh ([SumatraPDF](https://www.sumatrapdfreader.org/), [Okular](https://okular.kde.org/), ...) and set it as your default PDF reader. Another solution is to `render()` the graph to a different output format.
|
|
1105
1111
|
|
|
1106
1112
|
- When graph edges overlap it can be hard to distinguish them. Using an interactive graphviz viewer, such as [xdot](https://github.com/jrfonseca/xdot.py), on a '*.gv' DOT output file will help.
|
|
1107
1113
|
|
|
@@ -13,6 +13,10 @@ Run a live demo in the 👉 [**Memory Graph Web Debugger**](https://memory-graph
|
|
|
13
13
|
- **visualize the structure of your data** to easily understand and debug any data structure
|
|
14
14
|
- understand function calls, variable scope, and the **complete program state** through call stack visualization
|
|
15
15
|
|
|
16
|
+
An example Binary Tree data structure:
|
|
17
|
+

|
|
18
|
+
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).
|
|
19
|
+
|
|
16
20
|
# Videos #
|
|
17
21
|
| [](https://www.youtube.com/watch?v=23_bHcr7hqo) | [](https://www.youtube.com/watch?v=pvIJgHCaXhU) |
|
|
18
22
|
|:--:|:--:|
|
|
@@ -87,7 +91,7 @@ identical?: True
|
|
|
87
91
|
```
|
|
88
92
|
A better way to understand what values are shared is to draw a graph using [memory_graph](https://pypi.org/project/memory-graph/).
|
|
89
93
|
|
|
90
|
-
#
|
|
94
|
+
# Topics #
|
|
91
95
|
|
|
92
96
|
[Python Data Model](#python-data-model)
|
|
93
97
|
|
|
@@ -128,8 +132,8 @@ Bas Terwijn
|
|
|
128
132
|
Inspired by [Python Tutor](https://pythontutor.com/).
|
|
129
133
|
|
|
130
134
|
## Social Media #
|
|
131
|
-
* LinkedIn
|
|
132
|
-
* Reddit
|
|
135
|
+
* [LinkedIn](https://www.linkedin.com/groups/13244150/)
|
|
136
|
+
* [Reddit](https://www.reddit.com/r/Python_memory_graph/)
|
|
133
137
|
|
|
134
138
|
## Supported by ##
|
|
135
139
|
<img src="https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/uva.png" alt="University of Amsterdam" width="600">
|
|
@@ -353,8 +357,8 @@ and the result is: 1 x 2 x 3 x 4 = 24
|
|
|
353
357
|
|
|
354
358
|
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/factorial.py×tep=1.0&play).
|
|
355
359
|
|
|
356
|
-
## Binary
|
|
357
|
-
A more interesting recursive example is function `binary()` that converts a decimal
|
|
360
|
+
## Binary Conversion ##
|
|
361
|
+
A more interesting recursive example is function `binary()` that converts a integer from decimal to binary representation.
|
|
358
362
|
```python
|
|
359
363
|
import memory_graph as mg
|
|
360
364
|
mg.config.type_to_horizontal[list] = True # horizontal lists
|
|
@@ -372,7 +376,7 @@ print( binary(100) )
|
|
|
372
376
|
```
|
|
373
377
|

|
|
374
378
|
```
|
|
375
|
-
|
|
379
|
+
[1, 1, 0, 0, 1, 0, 0]
|
|
376
380
|
```
|
|
377
381
|
|
|
378
382
|
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/binary_convert.py×tep=1.0&play).
|
|
@@ -407,6 +411,8 @@ print( power_set(['a', 'b', 'c']) )
|
|
|
407
411
|
[['a', 'b', 'c'], ['a', 'b'], ['a', 'c'], ['a'], ['b', 'c'], ['b'], ['c'], []]
|
|
408
412
|
```
|
|
409
413
|
|
|
414
|
+
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/power_set.py×tep=1.0&play).
|
|
415
|
+
|
|
410
416
|
# Debugging #
|
|
411
417
|
|
|
412
418
|
For the best debugging experience with memory_graph set for example expression:
|
|
@@ -1056,7 +1062,7 @@ $ bash create_gif.sh animated
|
|
|
1056
1062
|
```
|
|
1057
1063
|
|
|
1058
1064
|
# Troubleshooting #
|
|
1059
|
-
- Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open '
|
|
1065
|
+
- Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open 'memory_graph.pdf' for writing : Permission denied` error. One solution is to install a PDF reader that does refresh ([SumatraPDF](https://www.sumatrapdfreader.org/), [Okular](https://okular.kde.org/), ...) and set it as your default PDF reader. Another solution is to `render()` the graph to a different output format.
|
|
1060
1066
|
|
|
1061
1067
|
- When graph edges overlap it can be hard to distinguish them. Using an interactive graphviz viewer, such as [xdot](https://github.com/jrfonseca/xdot.py), on a '*.gv' DOT output file will help.
|
|
1062
1068
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memory_graph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.55
|
|
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
|
|
@@ -58,6 +58,10 @@ Run a live demo in the 👉 [**Memory Graph Web Debugger**](https://memory-graph
|
|
|
58
58
|
- **visualize the structure of your data** to easily understand and debug any data structure
|
|
59
59
|
- understand function calls, variable scope, and the **complete program state** through call stack visualization
|
|
60
60
|
|
|
61
|
+
An example Binary Tree data structure:
|
|
62
|
+

|
|
63
|
+
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).
|
|
64
|
+
|
|
61
65
|
# Videos #
|
|
62
66
|
| [](https://www.youtube.com/watch?v=23_bHcr7hqo) | [](https://www.youtube.com/watch?v=pvIJgHCaXhU) |
|
|
63
67
|
|:--:|:--:|
|
|
@@ -132,7 +136,7 @@ identical?: True
|
|
|
132
136
|
```
|
|
133
137
|
A better way to understand what values are shared is to draw a graph using [memory_graph](https://pypi.org/project/memory-graph/).
|
|
134
138
|
|
|
135
|
-
#
|
|
139
|
+
# Topics #
|
|
136
140
|
|
|
137
141
|
[Python Data Model](#python-data-model)
|
|
138
142
|
|
|
@@ -173,8 +177,8 @@ Bas Terwijn
|
|
|
173
177
|
Inspired by [Python Tutor](https://pythontutor.com/).
|
|
174
178
|
|
|
175
179
|
## Social Media #
|
|
176
|
-
* LinkedIn
|
|
177
|
-
* Reddit
|
|
180
|
+
* [LinkedIn](https://www.linkedin.com/groups/13244150/)
|
|
181
|
+
* [Reddit](https://www.reddit.com/r/Python_memory_graph/)
|
|
178
182
|
|
|
179
183
|
## Supported by ##
|
|
180
184
|
<img src="https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/uva.png" alt="University of Amsterdam" width="600">
|
|
@@ -398,8 +402,8 @@ and the result is: 1 x 2 x 3 x 4 = 24
|
|
|
398
402
|
|
|
399
403
|
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/factorial.py×tep=1.0&play).
|
|
400
404
|
|
|
401
|
-
## Binary
|
|
402
|
-
A more interesting recursive example is function `binary()` that converts a decimal
|
|
405
|
+
## Binary Conversion ##
|
|
406
|
+
A more interesting recursive example is function `binary()` that converts a integer from decimal to binary representation.
|
|
403
407
|
```python
|
|
404
408
|
import memory_graph as mg
|
|
405
409
|
mg.config.type_to_horizontal[list] = True # horizontal lists
|
|
@@ -417,7 +421,7 @@ print( binary(100) )
|
|
|
417
421
|
```
|
|
418
422
|

|
|
419
423
|
```
|
|
420
|
-
|
|
424
|
+
[1, 1, 0, 0, 1, 0, 0]
|
|
421
425
|
```
|
|
422
426
|
|
|
423
427
|
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/binary_convert.py×tep=1.0&play).
|
|
@@ -452,6 +456,8 @@ print( power_set(['a', 'b', 'c']) )
|
|
|
452
456
|
[['a', 'b', 'c'], ['a', 'b'], ['a', 'c'], ['a'], ['b', 'c'], ['b'], ['c'], []]
|
|
453
457
|
```
|
|
454
458
|
|
|
459
|
+
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/power_set.py×tep=1.0&play).
|
|
460
|
+
|
|
455
461
|
# Debugging #
|
|
456
462
|
|
|
457
463
|
For the best debugging experience with memory_graph set for example expression:
|
|
@@ -1101,7 +1107,7 @@ $ bash create_gif.sh animated
|
|
|
1101
1107
|
```
|
|
1102
1108
|
|
|
1103
1109
|
# Troubleshooting #
|
|
1104
|
-
- Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open '
|
|
1110
|
+
- Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open 'memory_graph.pdf' for writing : Permission denied` error. One solution is to install a PDF reader that does refresh ([SumatraPDF](https://www.sumatrapdfreader.org/), [Okular](https://okular.kde.org/), ...) and set it as your default PDF reader. Another solution is to `render()` the graph to a different output format.
|
|
1105
1111
|
|
|
1106
1112
|
- When graph edges overlap it can be hard to distinguish them. Using an interactive graphviz viewer, such as [xdot](https://github.com/jrfonseca/xdot.py), on a '*.gv' DOT output file will help.
|
|
1107
1113
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "memory_graph"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.55"
|
|
8
8
|
description = "Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy."
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Bas Terwijn", email = "bterwijn@gmail.com"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|