Skip to content
Snippets Groups Projects
Commit cee86ae0 authored by Joseph Weston's avatar Joseph Weston
Browse files

change return format of __setstate__ for clarity

parent c6ef1826
No related branches found
No related tags found
No related merge requests found
......@@ -719,15 +719,17 @@ cdef class CGraph_malloc(CGraph):
init_args = (twoway, edge_nr_translation, num_nodes,
num_pp_edges, num_pn_edges, num_np_edges)
return (init_args, self._heads_idxs, self._heads, self._tails_idxs,
self._tails, self._edge_ids, self._edge_ids_by_edge_nr)
return init_args, (self._heads_idxs, self._heads, self._tails_idxs,
self._tails, self._edge_ids,
self._edge_ids_by_edge_nr)
def __setstate__(self, state):
self.__init__(*state[0])
init_args, arrays = state
self.__init__(*init_args)
array_attributes = (self._heads_idxs, self._heads, self._tails_idxs,
self._tails, self._edge_ids,
self._edge_ids_by_edge_nr)
for attribute, value in zip(array_attributes, state[1:]):
for attribute, value in zip(array_attributes, arrays):
if attribute is None:
continue
attribute[:] = value
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment