memory-graph 0.3.1__tar.gz → 0.3.3__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 (38) hide show
  1. {memory_graph-0.3.1 → memory_graph-0.3.3}/PKG-INFO +5 -7
  2. {memory_graph-0.3.1 → memory_graph-0.3.3}/README.md +3 -3
  3. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/__init__.py +1 -1
  4. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/extension_numpy.py +2 -2
  5. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/memory_to_nodes.py +3 -2
  6. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/node_base.py +6 -0
  7. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph.egg-info/PKG-INFO +6 -8
  8. {memory_graph-0.3.1 → memory_graph-0.3.3}/setup.py +1 -1
  9. {memory_graph-0.3.1 → memory_graph-0.3.3}/LICENSE.txt +0 -0
  10. {memory_graph-0.3.1 → memory_graph-0.3.3}/MANIFEST.in +0 -0
  11. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/config.py +0 -0
  12. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/config_default.py +0 -0
  13. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/config_helpers.py +0 -0
  14. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/extension_pandas.py +0 -0
  15. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/html_table.py +0 -0
  16. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/list_view.py +0 -0
  17. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/node_key_value.py +0 -0
  18. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/node_linear.py +0 -0
  19. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/node_table.py +0 -0
  20. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/sequence.py +0 -0
  21. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/slicer.py +0 -0
  22. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/slices.py +0 -0
  23. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/slices_iterator.py +0 -0
  24. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/slices_table_iterator.py +0 -0
  25. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/t.py +0 -0
  26. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test.py +0 -0
  27. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test_memory_graph.py +0 -0
  28. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test_memory_to_nodes.py +0 -0
  29. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test_sequence.py +0 -0
  30. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test_slicer.py +0 -0
  31. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test_slices.py +0 -0
  32. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/test_slices_iterator.py +0 -0
  33. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph/utils.py +0 -0
  34. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph.egg-info/SOURCES.txt +0 -0
  35. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph.egg-info/dependency_links.txt +0 -0
  36. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph.egg-info/requires.txt +0 -0
  37. {memory_graph-0.3.1 → memory_graph-0.3.3}/memory_graph.egg-info/top_level.txt +0 -0
  38. {memory_graph-0.3.1 → memory_graph-0.3.3}/setup.cfg +0 -0
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: memory_graph
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Draws a graph of your data to analyze its structure.
5
5
  Home-page: https://github.com/bterwijn/memory_graph
6
6
  Author: Bas Terwijn
7
7
  Author-email: bterwijn@gmail.com
8
8
  License: BSD 2-clause
9
- Platform: UNKNOWN
10
9
  Classifier: Development Status :: 4 - Beta
11
10
  Classifier: Intended Audience :: Education
12
11
  Classifier: Intended Audience :: Developers
@@ -16,6 +15,7 @@ Classifier: Topic :: Education
16
15
  Classifier: Topic :: Software Development :: Debuggers
17
16
  Description-Content-Type: text/markdown
18
17
  License-File: LICENSE.txt
18
+ Requires-Dist: graphviz
19
19
 
20
20
  # Installation #
21
21
  Install (or upgrade) `memory_graph` using pip:
@@ -131,7 +131,7 @@ The [Python Data Model](https://docs.python.org/3/reference/datamodel.html) make
131
131
  In the code below variable `a` and `b` both reference the same `int` value 10. An `int` is an immutable type and therefore when we change variable `a` its value can **not** be mutated in place, and thus a copy is made and `a` and `b` reference a different value afterwards.
132
132
  ```python
133
133
  import memory_graph
134
- memory_graph.config.not_node_types.remove(int) # show references to ints
134
+ memory_graph.config.not_node_types.remove(int) # show nodes for ints
135
135
 
136
136
  a = 10
137
137
  b = a
@@ -462,8 +462,8 @@ Different aspects of memory_graph can be configured. The default configuration i
462
462
  - ***memory_graph.config.max_string_length*** : int
463
463
  - The maximum length of strings shown in the graph. Longer strings will be truncated.
464
464
 
465
- - ***memory_graph.config.no_reference_types*** : dict
466
- - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node. It maps each type to a function that determines how it is visualized.
465
+ - ***memory_graph.config.not_node_types*** : set
466
+ - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node.
467
467
 
468
468
  - ***memory_graph.config.no_child_references_types*** : set
469
469
  - 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.
@@ -550,5 +550,3 @@ See for example [jupyter_example.ipynb](https://raw.githubusercontent.com/bterwi
550
550
 
551
551
  - 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.
552
552
 
553
-
554
-
@@ -112,7 +112,7 @@ The [Python Data Model](https://docs.python.org/3/reference/datamodel.html) make
112
112
  In the code below variable `a` and `b` both reference the same `int` value 10. An `int` is an immutable type and therefore when we change variable `a` its value can **not** be mutated in place, and thus a copy is made and `a` and `b` reference a different value afterwards.
113
113
  ```python
114
114
  import memory_graph
115
- memory_graph.config.not_node_types.remove(int) # show references to ints
115
+ memory_graph.config.not_node_types.remove(int) # show nodes for ints
116
116
 
117
117
  a = 10
118
118
  b = a
@@ -443,8 +443,8 @@ Different aspects of memory_graph can be configured. The default configuration i
443
443
  - ***memory_graph.config.max_string_length*** : int
444
444
  - The maximum length of strings shown in the graph. Longer strings will be truncated.
445
445
 
446
- - ***memory_graph.config.no_reference_types*** : dict
447
- - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node. It maps each type to a function that determines how it is visualized.
446
+ - ***memory_graph.config.not_node_types*** : set
447
+ - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node.
448
448
 
449
449
  - ***memory_graph.config.no_child_references_types*** : set
450
450
  - 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.
@@ -9,7 +9,7 @@ import sys
9
9
 
10
10
  import graphviz
11
11
 
12
- __version__ = "0.3.01"
12
+ __version__ = "0.3.03"
13
13
  __author__ = 'Bas Terwijn'
14
14
 
15
15
  log_file=sys.stdout
@@ -8,8 +8,8 @@ import numpy as np
8
8
 
9
9
  config.not_node_types |= {
10
10
  np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64,
11
- np.float16, np.float32, np.float64, np.float_,
12
- np.complex64, np.complex128, np.complex_,
11
+ np.float16, np.float32, np.float64,
12
+ np.complex64, np.complex128,
13
13
  np.bool_, np.bytes_, np.str_, np.datetime64, np.timedelta64
14
14
  }
15
15
 
@@ -31,7 +31,8 @@ def read_nodes(data):
31
31
  for index in node.get_children().indices_all():
32
32
  child = node.get_children()[index]
33
33
  memory_to_nodes_recursive(nodes, child, node, index)
34
- node.add_parent_index(parent, parent_index)
34
+ if not parent is None:
35
+ node.add_parent_index(parent, parent_index)
35
36
 
36
37
  nodes = {}
37
38
  memory_to_nodes_recursive(nodes, data, None, None)
@@ -135,7 +136,7 @@ def add_to_graphviz_graph(graphviz_graph, nodes, node, slices, id_to_slices, sub
135
136
  html_table = node.get_html_table(nodes, slices, id_to_slices)
136
137
  edges = html_table.get_edges()
137
138
  color = config_helpers.get_color(node)
138
- border = 1 #3 if node.is_root() else 1 # TODO
139
+ border = 3 if node.is_root() else 1
139
140
  graphviz_graph.node(node.get_name(),
140
141
  html_table.to_string(border, color),
141
142
  xlabel=node.get_label(slices))
@@ -30,6 +30,12 @@ class Node_Base:
30
30
  self.parent_indices[parent] = []
31
31
  self.parent_indices[parent].append(parent_index)
32
32
 
33
+ def is_root(self):
34
+ """
35
+ Return if the node is the root node.
36
+ """
37
+ return len(self.parent_indices) == 0
38
+
33
39
  def get_parent_indices(self):
34
40
  return self.parent_indices
35
41
 
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
- Name: memory-graph
3
- Version: 0.3.1
2
+ Name: memory_graph
3
+ Version: 0.3.3
4
4
  Summary: Draws a graph of your data to analyze its structure.
5
5
  Home-page: https://github.com/bterwijn/memory_graph
6
6
  Author: Bas Terwijn
7
7
  Author-email: bterwijn@gmail.com
8
8
  License: BSD 2-clause
9
- Platform: UNKNOWN
10
9
  Classifier: Development Status :: 4 - Beta
11
10
  Classifier: Intended Audience :: Education
12
11
  Classifier: Intended Audience :: Developers
@@ -16,6 +15,7 @@ Classifier: Topic :: Education
16
15
  Classifier: Topic :: Software Development :: Debuggers
17
16
  Description-Content-Type: text/markdown
18
17
  License-File: LICENSE.txt
18
+ Requires-Dist: graphviz
19
19
 
20
20
  # Installation #
21
21
  Install (or upgrade) `memory_graph` using pip:
@@ -131,7 +131,7 @@ The [Python Data Model](https://docs.python.org/3/reference/datamodel.html) make
131
131
  In the code below variable `a` and `b` both reference the same `int` value 10. An `int` is an immutable type and therefore when we change variable `a` its value can **not** be mutated in place, and thus a copy is made and `a` and `b` reference a different value afterwards.
132
132
  ```python
133
133
  import memory_graph
134
- memory_graph.config.not_node_types.remove(int) # show references to ints
134
+ memory_graph.config.not_node_types.remove(int) # show nodes for ints
135
135
 
136
136
  a = 10
137
137
  b = a
@@ -462,8 +462,8 @@ Different aspects of memory_graph can be configured. The default configuration i
462
462
  - ***memory_graph.config.max_string_length*** : int
463
463
  - The maximum length of strings shown in the graph. Longer strings will be truncated.
464
464
 
465
- - ***memory_graph.config.no_reference_types*** : dict
466
- - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node. It maps each type to a function that determines how it is visualized.
465
+ - ***memory_graph.config.not_node_types*** : set
466
+ - Holds all types for which no seperate node is drawn but that instead are shown as elements in their parent Node.
467
467
 
468
468
  - ***memory_graph.config.no_child_references_types*** : set
469
469
  - 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.
@@ -550,5 +550,3 @@ See for example [jupyter_example.ipynb](https://raw.githubusercontent.com/bterwi
550
550
 
551
551
  - 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.
552
552
 
553
-
554
-
@@ -7,7 +7,7 @@ long_description_from_readme = (this_directory / "README.md").read_text()
7
7
 
8
8
  setup(
9
9
  name = 'memory_graph',
10
- version = '0.3.01',
10
+ version = '0.3.03',
11
11
  description = 'Draws a graph of your data to analyze its structure.',
12
12
  long_description = long_description_from_readme,
13
13
  long_description_content_type = 'text/markdown',
File without changes
File without changes
File without changes