MCPcopy
hub / github.com/dmlc/dgl / readonly

Method readonly

python/dgl/graph_index.py:150–162  ·  view source on GitHub ↗

Set the readonly state of graph index in-place. Parameters ---------- readonly_state : bool New readonly state of current graph index.

(self, readonly_state=True)

Source from the content-addressed store, hash-verified

148 return self._readonly
149
150 def readonly(self, readonly_state=True):
151 """Set the readonly state of graph index in-place.
152
153 Parameters
154 ----------
155 readonly_state : bool
156 New readonly state of current graph index.
157 """
158 # TODO(minjie): very ugly code, should fix this
159 n_nodes, _, src, dst = self.__getstate__()
160 self.clear_cache()
161 state = (n_nodes, readonly_state, src, dst)
162 self.__setstate__(state)
163
164 def num_nodes(self):
165 """Return the number of nodes.

Callers

nothing calls this directly

Calls 3

__getstate__Method · 0.95
clear_cacheMethod · 0.95
__setstate__Method · 0.95

Tested by

no test coverage detected