MCPcopy Create free account
hub / github.com/CyberPoint/libpgm / load

Method load

libpgm/graphskeleton.py:47–71  ·  view source on GitHub ↗

Load the graph skeleton from a text file located at *path*. Text file must be a plaintext .txt file with a JSON-style representation of a dict. Dict must contain the top-level keys "V" and "E" with the following formats:: { 'V': ['<vertex_name

(self, path)

Source from the content-addressed store, hash-verified

45 '''(Inherited from dictionary) A variable that stores a key-indexable dictionary once it is loaded from a file.'''
46
47 def load(self, path):
48 ''&#x27;
49 Load the graph skeleton from a text file located at *path*.
50
51 Text file must be a plaintext .txt file with a JSON-style representation of a dict. Dict must contain the top-level keys "V" and "E" with the following formats::
52
53 {
54 'V': ['<vertex_name_1>', ... , '<vertex_name_n'],
55 'E': [['vertex_of_origin', 'vertex_of_destination'], ... ]
56 }
57
58 Arguments:
59 1. *path* -- The path to the file containing input data (e.g., "mydictionary.txt").
60
61 Attributes modified:
62 1. *V* -- The set of vertices.
63 2. *E* -- The set of edges.
64
65 ''&#x27;
66 self.dictload(path)
67 self.V = self.alldata["V"]
68 self.E = self.alldata["E"]
69
70 # free unused memory
71 del self.alldata
72
73 def getparents(self, vertex):
74 ''&#x27;

Callers 8

timerFunction · 0.95
timerFunction · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95

Calls 1

dictloadMethod · 0.80

Tested by 6

setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76