memory-graph 0.3.41__tar.gz → 0.3.43__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.
Files changed (321) hide show
  1. {memory_graph-0.3.41/memory_graph.egg-info → memory_graph-0.3.43}/PKG-INFO +65 -29
  2. {memory_graph-0.3.41 → memory_graph-0.3.43}/README.md +64 -28
  3. memory_graph-0.3.43/images/-0 +0 -0
  4. memory_graph-0.3.43/images/.gif +0 -0
  5. memory_graph-0.3.43/images/.idea/.gitignore +8 -0
  6. memory_graph-0.3.43/images/.idea/images.iml +12 -0
  7. memory_graph-0.3.43/images/.idea/inspectionProfiles/profiles_settings.xml +6 -0
  8. memory_graph-0.3.43/images/.idea/misc.xml +7 -0
  9. memory_graph-0.3.43/images/.idea/modules.xml +8 -0
  10. memory_graph-0.3.43/images/.idea/vcs.xml +6 -0
  11. memory_graph-0.3.43/images/.idea/workspace.xml +83 -0
  12. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/add_one.gv +18 -18
  13. memory_graph-0.3.43/images/avltree.py~ +41 -0
  14. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_dir.gv +36 -34
  15. memory_graph-0.3.43/images/avltree_fail.gv +22 -0
  16. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_key_value.gv +12 -12
  17. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_leaf.gv +5 -5
  18. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_linear.gv +12 -12
  19. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_table.gv +12 -12
  20. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_search.gv +34 -34
  21. memory_graph-0.3.43/images/bin_search.py~ +42 -0
  22. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_search_linear.gv +29 -29
  23. memory_graph-0.3.43/images/bin_search_linear.py~ +42 -0
  24. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_tree.gv +35 -35
  25. memory_graph-0.3.43/images/bin_tree2.py +31 -0
  26. memory_graph-0.3.43/images/bin_tree2.py~ +31 -0
  27. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary0.gv +6 -6
  28. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary0.png +0 -0
  29. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary1.gv +8 -8
  30. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary1.png +0 -0
  31. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary10.gv +16 -16
  32. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary10.png +0 -0
  33. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary11.gv +14 -14
  34. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary11.png +0 -0
  35. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary12.gv +12 -12
  36. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary12.png +0 -0
  37. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary13.gv +10 -10
  38. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary13.png +0 -0
  39. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary14.gv +8 -8
  40. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary14.png +0 -0
  41. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary2.gv +10 -10
  42. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary2.png +0 -0
  43. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary3.gv +12 -12
  44. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary3.png +0 -0
  45. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary4.gv +14 -14
  46. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary4.png +0 -0
  47. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary5.gv +16 -16
  48. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary5.png +0 -0
  49. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary6.gv +18 -18
  50. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary6.png +0 -0
  51. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary7.gv +20 -20
  52. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary7.png +0 -0
  53. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary8.gv +20 -20
  54. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary8.png +0 -0
  55. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary9.gv +18 -18
  56. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary9.png +0 -0
  57. memory_graph-0.3.43/images/call_stack.txt +24 -0
  58. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/copies.gv +20 -20
  59. memory_graph-0.3.43/images/copies_immutable.gv +34 -0
  60. memory_graph-0.3.43/images/copies_immutable.png +0 -0
  61. memory_graph-0.3.43/images/copies_mix.gv +49 -0
  62. memory_graph-0.3.43/images/copies_mix.png +0 -0
  63. memory_graph-0.3.43/images/copy_immutable.gv +34 -0
  64. memory_graph-0.3.43/images/copy_immutable.png +0 -0
  65. memory_graph-0.3.43/images/copy_immutable.py +15 -0
  66. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/copy_method.gv +16 -16
  67. memory_graph-0.3.43/images/copy_mix.gv +49 -0
  68. memory_graph-0.3.43/images/copy_mix.png +0 -0
  69. memory_graph-0.3.43/images/copy_mix.py +15 -0
  70. memory_graph-0.3.43/images/copy_mix.py~ +15 -0
  71. memory_graph-0.3.43/images/copy_mutable.png +0 -0
  72. memory_graph-0.3.43/images/copy_mutable.py +15 -0
  73. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/create_images.sh +7 -6
  74. memory_graph-0.3.43/images/debug.gv +15 -0
  75. memory_graph-0.3.43/images/debug.pdf +0 -0
  76. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging0.gv +8 -8
  77. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging0.png +0 -0
  78. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging01.gv +8 -8
  79. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging02.gv +11 -11
  80. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging03.gv +13 -13
  81. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging04.gv +15 -15
  82. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging05.gv +17 -17
  83. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging06.gv +17 -17
  84. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging1.gv +11 -11
  85. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging1.png +0 -0
  86. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging2.gv +13 -13
  87. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging2.png +0 -0
  88. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging3.gv +15 -15
  89. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging3.png +0 -0
  90. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging4.gv +17 -17
  91. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging4.png +0 -0
  92. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging5.gv +17 -17
  93. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging5.png +0 -0
  94. memory_graph-0.3.41/images/introspect_depth.gv → memory_graph-0.3.43/images/depth.gv +56 -56
  95. memory_graph-0.3.43/images/depth.png +0 -0
  96. memory_graph-0.3.43/images/extension_numpy.gv +64 -0
  97. memory_graph-0.3.43/images/extension_numpy.png +0 -0
  98. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/extension_numpy.py +4 -3
  99. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/extension_pandas.gv +8 -8
  100. memory_graph-0.3.43/images/extension_torch.gv +51 -0
  101. memory_graph-0.3.43/images/extension_torch.png +0 -0
  102. memory_graph-0.3.43/images/extension_torch.py +10 -0
  103. memory_graph-0.3.43/images/extension_torch.py~ +10 -0
  104. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial0.gv +3 -3
  105. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial0.png +0 -0
  106. memory_graph-0.3.43/images/factorial01.gv +15 -0
  107. memory_graph-0.3.43/images/factorial02.gv +22 -0
  108. memory_graph-0.3.43/images/factorial03.gv +28 -0
  109. memory_graph-0.3.43/images/factorial04.gv +34 -0
  110. memory_graph-0.3.43/images/factorial05.gv +35 -0
  111. memory_graph-0.3.43/images/factorial06.gv +29 -0
  112. memory_graph-0.3.43/images/factorial07.gv +23 -0
  113. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial1.gv +6 -6
  114. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial1.png +0 -0
  115. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial2.gv +8 -8
  116. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial2.png +0 -0
  117. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial3.gv +10 -10
  118. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial3.png +0 -0
  119. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial4.gv +12 -12
  120. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial4.png +0 -0
  121. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial5.gv +14 -14
  122. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial5.png +0 -0
  123. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial6.gv +12 -12
  124. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial6.png +0 -0
  125. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial7.gv +10 -10
  126. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial7.png +0 -0
  127. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial8.gv +8 -8
  128. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial8.png +0 -0
  129. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial9.gv +6 -6
  130. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial9.png +0 -0
  131. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/hash_set.gv +29 -29
  132. memory_graph-0.3.43/images/hidden_edges.gv +37 -0
  133. memory_graph-0.3.43/images/hidden_edges.py +8 -0
  134. memory_graph-0.3.43/images/hidden_edges.py~ +9 -0
  135. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/highlight.gv +16 -16
  136. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/immutable1.gv +4 -4
  137. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/immutable2.gv +6 -6
  138. memory_graph-0.3.43/images/introspect_depth.gv +178 -0
  139. memory_graph-0.3.43/images/introspect_depth.py~ +26 -0
  140. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/linked_list.gv +20 -20
  141. memory_graph-0.3.43/images/log.txt +186 -0
  142. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/many_types.gv +12 -12
  143. memory_graph-0.3.43/images/memory_graph.gv +43 -0
  144. memory_graph-0.3.43/images/memory_graph.gv.pdf +0 -0
  145. memory_graph-0.3.43/images/memory_graph.pdf +0 -0
  146. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/mutable1.gv +4 -4
  147. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/mutable2.gv +4 -4
  148. memory_graph-0.3.43/images/my_graph.gv +31 -0
  149. memory_graph-0.3.43/images/my_graph.pdf +0 -0
  150. memory_graph-0.3.43/images/not_node_types.py~ +9 -0
  151. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/not_node_types1.gv +6 -6
  152. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/not_node_types2.gv +16 -16
  153. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set0.gv +11 -11
  154. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set0.png +0 -0
  155. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set1.gv +17 -17
  156. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set1.png +0 -0
  157. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set10.gv +36 -36
  158. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set10.png +0 -0
  159. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set11.gv +31 -31
  160. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set11.png +0 -0
  161. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set12.gv +31 -31
  162. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set12.png +0 -0
  163. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set13.gv +36 -36
  164. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set13.png +0 -0
  165. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set14.gv +41 -41
  166. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set14.png +0 -0
  167. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set15.gv +43 -43
  168. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set15.png +0 -0
  169. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set16.gv +40 -40
  170. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set16.png +0 -0
  171. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set17.gv +40 -40
  172. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set17.png +0 -0
  173. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set18.gv +45 -45
  174. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set18.png +0 -0
  175. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set19.gv +47 -47
  176. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set19.png +0 -0
  177. memory_graph-0.3.43/images/power_set19.png~ +0 -0
  178. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set2.gv +22 -22
  179. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set2.png +0 -0
  180. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set20.gv +44 -44
  181. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set20.png +0 -0
  182. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set21.gv +39 -39
  183. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set21.png +0 -0
  184. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set22.gv +34 -34
  185. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set22.png +0 -0
  186. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set23.gv +28 -28
  187. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set23.png +0 -0
  188. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set3.gv +27 -27
  189. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set3.png +0 -0
  190. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set4.gv +32 -32
  191. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set4.png +0 -0
  192. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set5.gv +34 -34
  193. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set5.png +0 -0
  194. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set6.gv +32 -32
  195. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set6.png +0 -0
  196. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set7.gv +32 -32
  197. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set7.png +0 -0
  198. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set8.gv +37 -37
  199. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set8.png +0 -0
  200. memory_graph-0.3.43/images/power_set8.png~ +0 -0
  201. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set9.gv +39 -39
  202. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set9.png +0 -0
  203. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/rebinding1.gv +4 -4
  204. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/rebinding2.gv +6 -6
  205. memory_graph-0.3.43/images/stack.txt +24 -0
  206. memory_graph-0.3.43/images/test.py +20 -0
  207. memory_graph-0.3.43/images/test.py~ +18 -0
  208. memory_graph-0.3.43/images/vsc.py +42 -0
  209. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/__init__.py +27 -48
  210. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/config_helpers.py +3 -22
  211. memory_graph-0.3.43/memory_graph/extension_numpy.py +33 -0
  212. memory_graph-0.3.43/memory_graph/extension_torch.py +6 -0
  213. memory_graph-0.3.43/memory_graph/pytorch_test.py +10 -0
  214. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_memory_to_nodes.py +1 -3
  215. {memory_graph-0.3.41 → memory_graph-0.3.43/memory_graph.egg-info}/PKG-INFO +65 -29
  216. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph.egg-info/SOURCES.txt +64 -8
  217. {memory_graph-0.3.41 → memory_graph-0.3.43}/pyproject.toml +1 -1
  218. memory_graph-0.3.43/setup.py +7 -0
  219. memory_graph-0.3.41/images/binary.py~ +0 -12
  220. memory_graph-0.3.41/images/cmp.sh +0 -3
  221. memory_graph-0.3.41/images/cmp.sh~ +0 -1
  222. memory_graph-0.3.41/images/extension_numpy.gv +0 -52
  223. memory_graph-0.3.41/images/extension_numpy.png +0 -0
  224. memory_graph-0.3.41/images/highlight.png +0 -0
  225. memory_graph-0.3.41/images/highlight.py +0 -15
  226. memory_graph-0.3.41/images/memory_graph.gv +0 -30
  227. memory_graph-0.3.41/images/memory_graph.pdf +0 -0
  228. memory_graph-0.3.41/images/name_rebinding.py~ +0 -7
  229. memory_graph-0.3.41/memory_graph/t.py +0 -6
  230. {memory_graph-0.3.41 → memory_graph-0.3.43}/LICENSE.txt +0 -0
  231. {memory_graph-0.3.41 → memory_graph-0.3.43}/MANIFEST.in +0 -0
  232. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/add_one.png +0 -0
  233. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/add_one.py +0 -0
  234. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree.py +0 -0
  235. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_dir.png +0 -0
  236. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_fail.png +0 -0
  237. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_key_value.png +0 -0
  238. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_leaf.png +0 -0
  239. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_linear.png +0 -0
  240. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/avltree_table.png +0 -0
  241. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_search.png +0 -0
  242. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_search.py +0 -0
  243. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_search_linear.png +0 -0
  244. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_tree.gif +0 -0
  245. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_tree.png +0 -0
  246. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/bin_tree.py +0 -0
  247. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary.gif +0 -0
  248. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/binary.py +0 -0
  249. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/colab_example.png +0 -0
  250. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/copies.png +0 -0
  251. /memory_graph-0.3.41/images/copies.py → /memory_graph-0.3.43/images/copy_immutable.py~ +0 -0
  252. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/copy_method.png +0 -0
  253. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/copy_method.py +0 -0
  254. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/create_gif.sh +0 -0
  255. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debug_vscode.png +0 -0
  256. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging.gif +0 -0
  257. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/debugging.py +0 -0
  258. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/extension_pandas.png +0 -0
  259. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/extension_pandas.py +0 -0
  260. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial.gif +0 -0
  261. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/factorial.py +0 -0
  262. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/hash_set.gif +0 -0
  263. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/hash_set.png +0 -0
  264. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/hash_set.py +0 -0
  265. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/hidden_edges.png +0 -0
  266. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/immutable.py +0 -0
  267. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/immutable1.png +0 -0
  268. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/immutable2.png +0 -0
  269. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/introspect_depth.png +0 -0
  270. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/introspect_depth.py +0 -0
  271. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/ipython.png +0 -0
  272. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/jupyter_example.png +0 -0
  273. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/linked_list.gif +0 -0
  274. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/linked_list.png +0 -0
  275. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/linked_list.py +0 -0
  276. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/many_types.png +0 -0
  277. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/many_types.py +0 -0
  278. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/mutable.py +0 -0
  279. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/mutable1.png +0 -0
  280. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/mutable2.png +0 -0
  281. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/name_rebinding.py +0 -0
  282. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/not_node_types.py +0 -0
  283. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/not_node_types1.png +0 -0
  284. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/not_node_types2.png +0 -0
  285. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set.gif +0 -0
  286. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/power_set.py +0 -0
  287. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/pyodide.png +0 -0
  288. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/rebinding1.png +0 -0
  289. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/rebinding2.png +0 -0
  290. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/uva.png +0 -0
  291. {memory_graph-0.3.41 → memory_graph-0.3.43}/images/vscode_copying.gif +0 -0
  292. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/call_stack.py +0 -0
  293. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/config.py +0 -0
  294. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/config_default.py +0 -0
  295. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/extension_pandas.py +0 -0
  296. /memory_graph-0.3.41/memory_graph/extension_numpy.py → /memory_graph-0.3.43/memory_graph/extension_pytorch.py +0 -0
  297. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/html_table.py +0 -0
  298. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/list_view.py +0 -0
  299. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/memory_to_nodes.py +0 -0
  300. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/node_base.py +0 -0
  301. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/node_key_value.py +0 -0
  302. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/node_leaf.py +0 -0
  303. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/node_linear.py +0 -0
  304. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/node_table.py +0 -0
  305. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/sequence.py +0 -0
  306. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/slicer.py +0 -0
  307. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/slices.py +0 -0
  308. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/slices_iterator.py +0 -0
  309. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/slices_table_iterator.py +0 -0
  310. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test.py +0 -0
  311. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_max_graph_depth.py +0 -0
  312. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_memory_graph.py +0 -0
  313. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_sequence.py +0 -0
  314. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_slicer.py +0 -0
  315. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_slices.py +0 -0
  316. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/test_slices_iterator.py +0 -0
  317. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph/utils.py +0 -0
  318. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph.egg-info/dependency_links.txt +0 -0
  319. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph.egg-info/requires.txt +0 -0
  320. {memory_graph-0.3.41 → memory_graph-0.3.43}/memory_graph.egg-info/top_level.txt +0 -0
  321. {memory_graph-0.3.41 → memory_graph-0.3.43}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memory_graph
3
- Version: 0.3.41
3
+ Version: 0.3.43
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-Expression: BSD-2-Clause
@@ -213,7 +213,7 @@ mg.show(locals())
213
213
  * `c2` is a **shallow copy**, only the value referenced by the first reference is copied, all the underlying values are shared
214
214
  * `c3` is a **deep copy**, all the values are copied, nothing is shared
215
215
 
216
- ![copies.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copies.png)
216
+ ![copy_mutbale.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_mutable.png)
217
217
 
218
218
 
219
219
  ## Custom Copy ##
@@ -242,6 +242,41 @@ mg.show(locals())
242
242
  ```
243
243
  ![copy_method.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_method.png)
244
244
 
245
+ ## Copying values of Immutable type ##
246
+ Because a value of immutable type will be copied automatically when it is changed, there is no need to copy it beforehand. Therefore, a shallow or deep copy of a value of immutable type will just result in an assignment to save time.
247
+
248
+ ```python
249
+ import memory_graph as mg
250
+ import copy
251
+
252
+ a = ( (1, 2), ('x', 'y') ) # a nested tuple
253
+
254
+ # three different ways to make a "copy" of 'a':
255
+ c1 = a
256
+ c2 = copy.copy(a)
257
+ c3 = copy.deepcopy(a)
258
+
259
+ mg.render(locals(), 'copy_immutable.png')
260
+ ```
261
+ ![copy_immutbale.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_immutable.png)
262
+
263
+ ## Copying a mix of Mutable and Immutable values ##
264
+ When copying a mix of values of mutable and immutable type, a deep copy will try to copy as few values of immutable type as possible in order to copy each value of mutable type.
265
+ ```python
266
+ import memory_graph as mg
267
+ import copy
268
+
269
+ a = ( [1, 2], ('x', 'y') ) # mix of mutable and immutable
270
+
271
+ # three different ways to make a "copy" of 'a':
272
+ c1 = a
273
+ c2 = copy.copy(a)
274
+ c3 = copy.deepcopy(a)
275
+
276
+ mg.render(locals(), 'copy_mix.png')
277
+ ```
278
+ ![copy_mix.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_mix.png)
279
+
245
280
  ## Name Rebinding ##
246
281
  When `a` and `b` share a mutable value, then changing the value of `b` changes the value of `a` and vice versa. However, reassigning `b` does not change `a`. When you reassign `b`, you only rebind the name `b` to a new value without effecting any other variables.
247
282
 
@@ -299,7 +334,7 @@ This function:
299
334
  * first executes `fun(arg1, arg2, ...)`
300
335
  * then prints the current source location in the program
301
336
  * then blocks execution until the &lt;Enter&gt; key is pressed
302
- * finally returns the value of the `fun()` call
337
+ * finally returns the return value of the `fun()` call
303
338
 
304
339
  ## Recursion ##
305
340
  The call stack is also helpful to visualize how recursion works. Here we use `mg.block()` to show each step of how recursively `factorial(4)` is computed:
@@ -323,7 +358,7 @@ print( factorial(4) )
323
358
  and the result is: 1 x 2 x 3 x 4 = 24
324
359
 
325
360
  ## Binary ##
326
- A more interesting recursive example is function `binary()` that converts an integer to binary representation.
361
+ A more interesting recursive example is function `binary()` that converts a decimal integer to binary representation.
327
362
  ```python
328
363
  import memory_graph as mg
329
364
  mg.config.type_to_vertical[list] = False # horizontal lists
@@ -385,7 +420,7 @@ as a *watch* in a debugger tool such as the integrated debugger in Visual Studio
385
420
  ## Call Stack in Watch Context ##
386
421
  The ```mg.stack()``` doesn't work well in *watch* context in most debuggers because debuggers introduce additional stack frames that cause problems. Use these alternative functions for various debuggers to filter out these problematic stack frames:
387
422
 
388
- | debugger | function to get the call stack |
423
+ | debugger | function to get the call stack in 'watch' context |
389
424
  |:---|:---|
390
425
  | [pdb](https://docs.python.org/3/library/pdb.html), [pudb](https://pypi.org/project/pudb/) | `mg.stack_pdb()` |
391
426
  | [Visual Studio Code](https://code.visualstudio.com/docs/languages/python) | `mg.stack_vscode()` |
@@ -588,13 +623,13 @@ Different aspects of memory_graph can be configured. The default configuration c
588
623
  - The maximum length of strings shown in the graph. Longer strings will be truncated.
589
624
 
590
625
  - ***mg.config.not_node_types*** : set[type]
591
- - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node.
626
+ - Holds all types for which no separate node is drawn but that instead are shown as elements in their parent Node.
592
627
 
593
628
  - ***mg.config.no_child_references_types*** : set[type]
594
629
  - The set of key_value types that don't draw references to their direct childeren but have their children shown as elements of their node.
595
630
 
596
631
  - ***mg.config.type_to_node*** : dict[type, fun(data) -> Node]
597
- - Determines how a data types is converted to a Node (sub)class for visualization in the graph.
632
+ - Determines how a data type is converted to a Node subclass for visualization in the graph.
598
633
 
599
634
  - ***mg.config.type_to_color*** : dict[type, color]
600
635
  - Maps a type to the [graphviz color](https://graphviz.org/doc/info/colors.html) it gets in the graph.
@@ -639,24 +674,6 @@ mg.render(locals(), 'not_node_types2.png')
639
674
 
640
675
  Additionally, the simplification hides away the [reuse of small int values \[-5, 256\]](https://docs.python.org/3/c-api/long.html#c.PyLong_FromLong) in the current CPython implementation, an optimization that might otherwise confuse beginner Python programmers. For instance, after executing `a[1]+=1; b[1]+=1` the `201` value is, maybe surprisingly, still shared between `a` and `b`, whereas executing `a[2]+=1; b[2]+=1` does not result in sharing the `301` value.
641
676
 
642
- ## Temporary Configuration ##
643
- In addition to the global configuration, a temporary configuration can be set for a single `show()` or `render()` call to change the colors, orientation, and slicer. This example highlights a particular list element in red, gives it a horizontal orientation, and overwrites the default slicer for lists:
644
-
645
- ```python
646
- import memory_graph as mg
647
- from memory_graph.slicer import Slicer
648
-
649
- data = [ list(range(20)) for i in range(1,5)]
650
- highlight = data[2]
651
-
652
- mg.show( locals(),
653
- colors = {id(highlight): "red" }, # set color to red
654
- verticals = {id(highlight): False }, # set horizontal orientation
655
- slicers = {id(highlight): Slicer()} # set no slicing
656
- )
657
- ```
658
- ![highlight.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/highlight.png)
659
-
660
677
  # Introspection #
661
678
  This section is likely to change. Sometimes the introspection fails or is not as desired. For example the `bintrees.avltree.Node` object doesn't show any attributes in the graph below.
662
679
 
@@ -699,7 +716,7 @@ mg.show(locals())
699
716
  ```
700
717
  ![extension_numpy.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/avltree_dir.png)
701
718
 
702
- Next figure out what are the attributes you want to graph and choose a Node type, there are four options:
719
+ Next figure out what the attributes are you want to graph and choose a Node type, there are four options:
703
720
 
704
721
  ## 1) Node_Leaf ##
705
722
  Node_Leaf is a node with no children and shows just a single value.
@@ -925,9 +942,11 @@ import numpy as np
925
942
  import memory_graph.extension_numpy
926
943
  np.random.seed(0) # use same random numbers each run
927
944
 
928
- array = np.array([1.1, 2, 3, 4, 5])
929
- matrix = np.matrix([[i*20+j for j in range(20)] for i in range(20)])
930
- ndarray = np.random.rand(20,20)
945
+ matrix = np.matrix([[i*5+j for j in range(4)] for i in range(5)])
946
+ ndarray_1d = np.array([1.1, 2, 3, 4, 5])
947
+ ndarray_2d = np.random.rand(3,2)
948
+ ndarray_3d = np.random.rand(2,2,2)
949
+
931
950
  mg.show(locals())
932
951
  ```
933
952
  ![extension_numpy.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/extension_numpy.png)
@@ -951,6 +970,23 @@ mg.show(locals())
951
970
  ```
952
971
  ![extension_pandas.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/extension_pandas.png)
953
972
 
973
+ ## PyTorch ##
974
+ Torch type `tensor` can be graphed with "memory_graph.extension_torch":
975
+
976
+ ```python
977
+ import memory_graph as mg
978
+ import torch
979
+ import memory_graph.extension_torch
980
+ torch.manual_seed(0) # same random numbers each run
981
+
982
+ tensor_1d = torch.rand(3)
983
+ tensor_2d = torch.rand(3, 2)
984
+ tensor_3d = torch.rand(2, 2, 2)
985
+
986
+ mg.show(locals())
987
+ ```
988
+ ![extension_torch.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/extension_torch.png)
989
+
954
990
  # Jupyter Notebook #
955
991
  In Jupyter Notebook `locals()` has additional variables that cause problems in the graph, use `mg.locals_jupyter()` to get the local variables with these problematic variables filtered out. Use `mg.stack_jupyter()` to get the whole call stack with these variables filtered out.
956
992
 
@@ -193,7 +193,7 @@ mg.show(locals())
193
193
  * `c2` is a **shallow copy**, only the value referenced by the first reference is copied, all the underlying values are shared
194
194
  * `c3` is a **deep copy**, all the values are copied, nothing is shared
195
195
 
196
- ![copies.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copies.png)
196
+ ![copy_mutbale.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_mutable.png)
197
197
 
198
198
 
199
199
  ## Custom Copy ##
@@ -222,6 +222,41 @@ mg.show(locals())
222
222
  ```
223
223
  ![copy_method.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_method.png)
224
224
 
225
+ ## Copying values of Immutable type ##
226
+ Because a value of immutable type will be copied automatically when it is changed, there is no need to copy it beforehand. Therefore, a shallow or deep copy of a value of immutable type will just result in an assignment to save time.
227
+
228
+ ```python
229
+ import memory_graph as mg
230
+ import copy
231
+
232
+ a = ( (1, 2), ('x', 'y') ) # a nested tuple
233
+
234
+ # three different ways to make a "copy" of 'a':
235
+ c1 = a
236
+ c2 = copy.copy(a)
237
+ c3 = copy.deepcopy(a)
238
+
239
+ mg.render(locals(), 'copy_immutable.png')
240
+ ```
241
+ ![copy_immutbale.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_immutable.png)
242
+
243
+ ## Copying a mix of Mutable and Immutable values ##
244
+ When copying a mix of values of mutable and immutable type, a deep copy will try to copy as few values of immutable type as possible in order to copy each value of mutable type.
245
+ ```python
246
+ import memory_graph as mg
247
+ import copy
248
+
249
+ a = ( [1, 2], ('x', 'y') ) # mix of mutable and immutable
250
+
251
+ # three different ways to make a "copy" of 'a':
252
+ c1 = a
253
+ c2 = copy.copy(a)
254
+ c3 = copy.deepcopy(a)
255
+
256
+ mg.render(locals(), 'copy_mix.png')
257
+ ```
258
+ ![copy_mix.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/copy_mix.png)
259
+
225
260
  ## Name Rebinding ##
226
261
  When `a` and `b` share a mutable value, then changing the value of `b` changes the value of `a` and vice versa. However, reassigning `b` does not change `a`. When you reassign `b`, you only rebind the name `b` to a new value without effecting any other variables.
227
262
 
@@ -279,7 +314,7 @@ This function:
279
314
  * first executes `fun(arg1, arg2, ...)`
280
315
  * then prints the current source location in the program
281
316
  * then blocks execution until the &lt;Enter&gt; key is pressed
282
- * finally returns the value of the `fun()` call
317
+ * finally returns the return value of the `fun()` call
283
318
 
284
319
  ## Recursion ##
285
320
  The call stack is also helpful to visualize how recursion works. Here we use `mg.block()` to show each step of how recursively `factorial(4)` is computed:
@@ -303,7 +338,7 @@ print( factorial(4) )
303
338
  and the result is: 1 x 2 x 3 x 4 = 24
304
339
 
305
340
  ## Binary ##
306
- A more interesting recursive example is function `binary()` that converts an integer to binary representation.
341
+ A more interesting recursive example is function `binary()` that converts a decimal integer to binary representation.
307
342
  ```python
308
343
  import memory_graph as mg
309
344
  mg.config.type_to_vertical[list] = False # horizontal lists
@@ -365,7 +400,7 @@ as a *watch* in a debugger tool such as the integrated debugger in Visual Studio
365
400
  ## Call Stack in Watch Context ##
366
401
  The ```mg.stack()``` doesn't work well in *watch* context in most debuggers because debuggers introduce additional stack frames that cause problems. Use these alternative functions for various debuggers to filter out these problematic stack frames:
367
402
 
368
- | debugger | function to get the call stack |
403
+ | debugger | function to get the call stack in 'watch' context |
369
404
  |:---|:---|
370
405
  | [pdb](https://docs.python.org/3/library/pdb.html), [pudb](https://pypi.org/project/pudb/) | `mg.stack_pdb()` |
371
406
  | [Visual Studio Code](https://code.visualstudio.com/docs/languages/python) | `mg.stack_vscode()` |
@@ -568,13 +603,13 @@ Different aspects of memory_graph can be configured. The default configuration c
568
603
  - The maximum length of strings shown in the graph. Longer strings will be truncated.
569
604
 
570
605
  - ***mg.config.not_node_types*** : set[type]
571
- - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node.
606
+ - Holds all types for which no separate node is drawn but that instead are shown as elements in their parent Node.
572
607
 
573
608
  - ***mg.config.no_child_references_types*** : set[type]
574
609
  - The set of key_value types that don't draw references to their direct childeren but have their children shown as elements of their node.
575
610
 
576
611
  - ***mg.config.type_to_node*** : dict[type, fun(data) -> Node]
577
- - Determines how a data types is converted to a Node (sub)class for visualization in the graph.
612
+ - Determines how a data type is converted to a Node subclass for visualization in the graph.
578
613
 
579
614
  - ***mg.config.type_to_color*** : dict[type, color]
580
615
  - Maps a type to the [graphviz color](https://graphviz.org/doc/info/colors.html) it gets in the graph.
@@ -619,24 +654,6 @@ mg.render(locals(), 'not_node_types2.png')
619
654
 
620
655
  Additionally, the simplification hides away the [reuse of small int values \[-5, 256\]](https://docs.python.org/3/c-api/long.html#c.PyLong_FromLong) in the current CPython implementation, an optimization that might otherwise confuse beginner Python programmers. For instance, after executing `a[1]+=1; b[1]+=1` the `201` value is, maybe surprisingly, still shared between `a` and `b`, whereas executing `a[2]+=1; b[2]+=1` does not result in sharing the `301` value.
621
656
 
622
- ## Temporary Configuration ##
623
- In addition to the global configuration, a temporary configuration can be set for a single `show()` or `render()` call to change the colors, orientation, and slicer. This example highlights a particular list element in red, gives it a horizontal orientation, and overwrites the default slicer for lists:
624
-
625
- ```python
626
- import memory_graph as mg
627
- from memory_graph.slicer import Slicer
628
-
629
- data = [ list(range(20)) for i in range(1,5)]
630
- highlight = data[2]
631
-
632
- mg.show( locals(),
633
- colors = {id(highlight): "red" }, # set color to red
634
- verticals = {id(highlight): False }, # set horizontal orientation
635
- slicers = {id(highlight): Slicer()} # set no slicing
636
- )
637
- ```
638
- ![highlight.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/highlight.png)
639
-
640
657
  # Introspection #
641
658
  This section is likely to change. Sometimes the introspection fails or is not as desired. For example the `bintrees.avltree.Node` object doesn't show any attributes in the graph below.
642
659
 
@@ -679,7 +696,7 @@ mg.show(locals())
679
696
  ```
680
697
  ![extension_numpy.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/avltree_dir.png)
681
698
 
682
- Next figure out what are the attributes you want to graph and choose a Node type, there are four options:
699
+ Next figure out what the attributes are you want to graph and choose a Node type, there are four options:
683
700
 
684
701
  ## 1) Node_Leaf ##
685
702
  Node_Leaf is a node with no children and shows just a single value.
@@ -905,9 +922,11 @@ import numpy as np
905
922
  import memory_graph.extension_numpy
906
923
  np.random.seed(0) # use same random numbers each run
907
924
 
908
- array = np.array([1.1, 2, 3, 4, 5])
909
- matrix = np.matrix([[i*20+j for j in range(20)] for i in range(20)])
910
- ndarray = np.random.rand(20,20)
925
+ matrix = np.matrix([[i*5+j for j in range(4)] for i in range(5)])
926
+ ndarray_1d = np.array([1.1, 2, 3, 4, 5])
927
+ ndarray_2d = np.random.rand(3,2)
928
+ ndarray_3d = np.random.rand(2,2,2)
929
+
911
930
  mg.show(locals())
912
931
  ```
913
932
  ![extension_numpy.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/extension_numpy.png)
@@ -931,6 +950,23 @@ mg.show(locals())
931
950
  ```
932
951
  ![extension_pandas.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/extension_pandas.png)
933
952
 
953
+ ## PyTorch ##
954
+ Torch type `tensor` can be graphed with "memory_graph.extension_torch":
955
+
956
+ ```python
957
+ import memory_graph as mg
958
+ import torch
959
+ import memory_graph.extension_torch
960
+ torch.manual_seed(0) # same random numbers each run
961
+
962
+ tensor_1d = torch.rand(3)
963
+ tensor_2d = torch.rand(3, 2)
964
+ tensor_3d = torch.rand(2, 2, 2)
965
+
966
+ mg.show(locals())
967
+ ```
968
+ ![extension_torch.png](https://raw.githubusercontent.com/bterwijn/memory_graph/main/images/extension_torch.png)
969
+
934
970
  # Jupyter Notebook #
935
971
  In Jupyter Notebook `locals()` has additional variables that cause problems in the graph, use `mg.locals_jupyter()` to get the local variables with these problematic variables filtered out. Use `mg.stack_jupyter()` to get the whole call stack with these variables filtered out.
936
972
 
Binary file
File without changes
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="jdk" jdkName="Python 3.13 virtualenv at ~/python3.13_env" jdkType="Python SDK" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ <component name="PyDocumentationSettings">
9
+ <option name="format" value="PLAIN" />
10
+ <option name="myDocStringFormat" value="Plain" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.13 virtualenv at ~/python3.13_env" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 virtualenv at ~/python3.13_env" project-jdk-type="Python SDK" />
7
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/images.iml" filepath="$PROJECT_DIR$/.idea/images.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,83 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AutoImportSettings">
4
+ <option name="autoReloadType" value="SELECTIVE" />
5
+ </component>
6
+ <component name="ChangeListManager">
7
+ <list default="true" id="6720a3cc-6c0b-46cb-bb85-b452407a2980" name="Changes" comment="" />
8
+ <option name="SHOW_DIALOG" value="false" />
9
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+ <option name="LAST_RESOLUTION" value="IGNORE" />
12
+ </component>
13
+ <component name="Git.Settings">
14
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
15
+ </component>
16
+ <component name="ProjectColorInfo">{
17
+ &quot;associatedIndex&quot;: 5
18
+ }</component>
19
+ <component name="ProjectId" id="2yB9ZteNF5pFmuhrHRsT32pNxbW" />
20
+ <component name="ProjectViewState">
21
+ <option name="hideEmptyMiddlePackages" value="true" />
22
+ <option name="showLibraryContents" value="true" />
23
+ </component>
24
+ <component name="PropertiesComponent">{
25
+ &quot;keyToString&quot;: {
26
+ &quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
27
+ &quot;Python.vsc.executor&quot;: &quot;Debug&quot;,
28
+ &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
29
+ &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
30
+ &quot;git-widget-placeholder&quot;: &quot;main&quot;,
31
+ &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
32
+ &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
33
+ &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
34
+ &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
35
+ &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
36
+ &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
37
+ }
38
+ }</component>
39
+ <component name="SharedIndexes">
40
+ <attachedChunks>
41
+ <set>
42
+ <option value="bundled-js-predefined-d6986cc7102b-6a121458b545-JavaScript-PY-251.25410.159" />
43
+ <option value="bundled-python-sdk-e0ed3721d81e-36ea0e71a18c-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-251.25410.159" />
44
+ </set>
45
+ </attachedChunks>
46
+ </component>
47
+ <component name="TaskManager">
48
+ <task active="true" id="Default" summary="Default task">
49
+ <changelist id="6720a3cc-6c0b-46cb-bb85-b452407a2980" name="Changes" comment="" />
50
+ <created>1749297161293</created>
51
+ <option name="number" value="Default" />
52
+ <option name="presentableId" value="Default" />
53
+ <updated>1749297161293</updated>
54
+ <workItem from="1749297163364" duration="1155000" />
55
+ <workItem from="1749298804721" duration="147000" />
56
+ <workItem from="1749299658479" duration="919000" />
57
+ </task>
58
+ <servers />
59
+ </component>
60
+ <component name="TypeScriptGeneratedFilesManager">
61
+ <option name="version" value="3" />
62
+ </component>
63
+ <component name="XDebuggerManager">
64
+ <breakpoint-manager>
65
+ <breakpoints>
66
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
67
+ <url>file://$PROJECT_DIR$/vsc.py</url>
68
+ <line>26</line>
69
+ <option name="timeStamp" value="3" />
70
+ </line-breakpoint>
71
+ </breakpoints>
72
+ </breakpoint-manager>
73
+ <watches-manager>
74
+ <configuration name="PythonConfigurationType">
75
+ <watch expression="mg.save_call_stack('stack.txt')" language="Python" />
76
+ <watch expression="mg.render(mg.stack_pycharm())" language="Python" />
77
+ </configuration>
78
+ </watches-manager>
79
+ </component>
80
+ <component name="com.intellij.coverage.CoverageDataManagerImpl">
81
+ <SUITE FILE_PATH="coverage/images$vsc.coverage" NAME="vsc Coverage Results" MODIFIED="1749300268269" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
82
+ </component>
83
+ </project>
@@ -1,6 +1,6 @@
1
1
  digraph memory_graph {
2
2
  node [shape=plaintext]
3
- node126342197744192 [label=<
3
+ node124410937527872 [label=<
4
4
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="lightcoral" PORT="table">
5
5
  <TR><TD BORDER="0"><font color="#505050">0</font></TD><TD BORDER="1"> 4 </TD></TR>
6
6
  <TR><TD BORDER="0"><font color="#505050">1</font></TD><TD BORDER="1"> 3 </TD></TR>
@@ -8,30 +8,30 @@ digraph memory_graph {
8
8
  <TR><TD BORDER="0"><font color="#505050">3</font></TD><TD BORDER="1"> 1 </TD></TR>
9
9
  </TABLE>
10
10
  > xlabel=list]
11
- node126342187335232 [label=<
11
+ node124410926965568 [label=<
12
12
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="orange" PORT="table">
13
13
  <TR><TD BORDER="0"><font color="#505050">0</font></TD><TD BORDER="1"> 4 </TD></TR>
14
14
  <TR><TD BORDER="0"><font color="#505050">1</font></TD><TD BORDER="1"> 3 </TD></TR>
15
15
  <TR><TD BORDER="0"><font color="#505050">2</font></TD><TD BORDER="1"> 2 </TD></TR>
16
16
  </TABLE>
17
17
  > xlabel=tuple]
18
- node126342197742400 [label=<
18
+ node124410926228608 [label=<
19
19
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="lightcoral" PORT="table">
20
20
  <TR><TD BORDER="0"><font color="#505050">0</font></TD><TD BORDER="1"> 4 </TD></TR>
21
21
  <TR><TD BORDER="0"><font color="#505050">1</font></TD><TD BORDER="1"> 3 </TD></TR>
22
22
  <TR><TD BORDER="0"><font color="#505050">2</font></TD><TD BORDER="1"> 2 </TD></TR>
23
23
  </TABLE>
24
24
  > xlabel=list]
25
- node126342187215040 [label=<
25
+ node124410926788224 [label=<
26
26
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="#60a5ff" PORT="table">
27
27
  <TR><TD BORDER="1" STYLE="ROUNDED"> a </TD><TD BORDER="1" STYLE="ROUNDED"> b </TD><TD BORDER="1" STYLE="ROUNDED"> c </TD></TR>
28
28
  <TR><TD BORDER="1" PORT="ref0"> </TD><TD BORDER="1" PORT="ref1"> </TD><TD BORDER="1" PORT="ref2"> </TD></TR>
29
29
  </TABLE>
30
30
  > xlabel=dict]
31
- node126342187215040:ref0 -> node126342197744192:table [style=solid]
32
- node126342187215040:ref1 -> node126342187335232:table [style=solid]
33
- node126342187215040:ref2 -> node126342197742400:table [style=solid]
34
- node126342197725200 [label=<
31
+ node124410926788224:ref0 -> node124410937527872:table [style=solid]
32
+ node124410926788224:ref1 -> node124410926965568:table [style=solid]
33
+ node124410926788224:ref2 -> node124410926228608:table [style=solid]
34
+ node124410937470832 [label=<
35
35
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="orange" PORT="table">
36
36
  <TR><TD BORDER="0"><font color="#505050">0</font></TD><TD BORDER="1"> 4 </TD></TR>
37
37
  <TR><TD BORDER="0"><font color="#505050">1</font></TD><TD BORDER="1"> 3 </TD></TR>
@@ -39,7 +39,7 @@ digraph memory_graph {
39
39
  <TR><TD BORDER="0"><font color="#505050">3</font></TD><TD BORDER="1"> 1 </TD></TR>
40
40
  </TABLE>
41
41
  > xlabel=tuple]
42
- node126342187331776 [label=<
42
+ node124410926965952 [label=<
43
43
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="lightcoral" PORT="table">
44
44
  <TR><TD BORDER="0"><font color="#505050">0</font></TD><TD BORDER="1"> 4 </TD></TR>
45
45
  <TR><TD BORDER="0"><font color="#505050">1</font></TD><TD BORDER="1"> 3 </TD></TR>
@@ -47,23 +47,23 @@ digraph memory_graph {
47
47
  <TR><TD BORDER="0"><font color="#505050">3</font></TD><TD BORDER="1"> 1 </TD></TR>
48
48
  </TABLE>
49
49
  > xlabel=list]
50
- node126342184895424 [label=<
50
+ node124410922387648 [label=<
51
51
  <TABLE BORDER="1" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="#60a5ff" PORT="table">
52
52
  <TR><TD BORDER="1" STYLE="ROUNDED"> a </TD><TD BORDER="1" STYLE="ROUNDED"> b </TD><TD BORDER="1" STYLE="ROUNDED"> c </TD></TR>
53
53
  <TR><TD BORDER="1" PORT="ref0"> </TD><TD BORDER="1" PORT="ref1"> </TD><TD BORDER="1" PORT="ref2"> </TD></TR>
54
54
  </TABLE>
55
55
  > xlabel=dict]
56
- node126342184895424:ref0 -> node126342197744192:table [style=solid]
57
- node126342184895424:ref1 -> node126342197725200:table [style=solid]
58
- node126342184895424:ref2 -> node126342187331776:table [style=solid]
59
- node126342184890960 [label=<
56
+ node124410922387648:ref0 -> node124410937527872:table [style=solid]
57
+ node124410922387648:ref1 -> node124410937470832:table [style=solid]
58
+ node124410922387648:ref2 -> node124410926965952:table [style=solid]
59
+ node124410922460144 [label=<
60
60
  <TABLE BORDER="3" CELLBORDER="1" CELLSPACING="5" CELLPADDING="0" BGCOLOR="khaki" PORT="table">
61
61
  <TR><TD BORDER="1" STYLE="ROUNDED"> 0: &lt;module&gt; </TD><TD BORDER="1" STYLE="ROUNDED"> 1: add_one </TD></TR>
62
62
  <TR><TD BORDER="1" PORT="ref0"> </TD><TD BORDER="1" PORT="ref1"> </TD></TR>
63
63
  </TABLE>
64
64
  > xlabel=call_stack]
65
- node126342184890960:ref0 -> node126342187215040:table [style=solid]
66
- node126342184890960:ref1 -> node126342184895424:table [style=solid]
67
- subgraph { rank=same; node126342187215040 -> node126342184895424[weight=10, style=invis]; }
68
- subgraph { rank=same; node126342197744192 -> node126342187335232 -> node126342197742400 -> node126342197725200 -> node126342187331776[weight=10, style=invis]; }
65
+ node124410922460144:ref0 -> node124410926788224:table [style=solid]
66
+ node124410922460144:ref1 -> node124410922387648:table [style=solid]
67
+ subgraph { rank=same; node124410926788224 -> node124410922387648[weight=10, style=invis]; }
68
+ subgraph { rank=same; node124410937527872 -> node124410926965568 -> node124410926228608 -> node124410937470832 -> node124410926965952[weight=10, style=invis]; }
69
69
  }
@@ -0,0 +1,41 @@
1
+ import memory_graph as mg
2
+ import bintrees
3
+
4
+ # Create an AVL tree
5
+ tree = bintrees.AVLTree()
6
+ tree.insert(10, "ten")
7
+ tree.insert(5, "five")
8
+ tree.insert(20, "twenty")
9
+ tree.insert(15, "fifteen")
10
+
11
+ mg.render(locals(), 'avltree_fail.png')
12
+
13
+ mg.config.type_to_color[bintrees.avltree.Node] = "sandybrown"
14
+ mg.render(locals(), 'avltree_color.png')
15
+
16
+ mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.node_linear.Node_Linear(data, dir(data))
17
+ mg.config.type_to_slicer[bintrees.avltree.Node] = mg.slicer.Slicer()
18
+ mg.render(locals(), 'avltree_dir.png')
19
+
20
+ mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.node_base.Node_Base(f"key:{data.key} value:{data.value}")
21
+ mg.render(locals(), 'avltree_base.png')
22
+
23
+ mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.node_linear.Node_Linear(data,
24
+ ['left', data.left,
25
+ 'key', data.key,
26
+ 'value', data.value,
27
+ 'right', data.right])
28
+ mg.render(locals(), 'avltree_linear.png')
29
+
30
+ mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.node_key_value.Node_Key_Value(data,
31
+ {'left': data.left,
32
+ 'key': data.key,
33
+ 'value': data.value,
34
+ 'right': data.right}.items())
35
+ mg.render(locals(), 'avltree_key_value.png')
36
+
37
+ mg.config.type_to_node[bintrees.avltree.Node] = lambda data: mg.node_table.Node_Table(data,
38
+ [[data.key, data.value],
39
+ [data.left, data.right]]
40
+ )
41
+ mg.render(locals(), 'avltree_table.png')