Set the readonly state of graph index in-place. Parameters ---------- readonly_state : bool New readonly state of current graph index.
(self, readonly_state=True)
| 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. |
nothing calls this directly
no test coverage detected