Skip to content

Commit bae0900

Browse files
remove erd.topological_sort -- it is never called
1 parent 29ca4c9 commit bae0900

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

datajoint/erd.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -197,31 +197,6 @@ def __mul__(self, arg):
197197
self.nodes_to_show.intersection_update(arg.nodes_to_show)
198198
return self
199199

200-
def topological_sort(self):
201-
"""
202-
:return: list of nodes in topological order
203-
"""
204-
205-
def _unite(lst):
206-
"""
207-
reorder list so that parts immediately follow their masters without breaking the topological order.
208-
Without this correction, simple topological sort may insert other descendants between master and parts
209-
:example:
210-
_unite(['a', 'a__q', 'b', 'c', 'c__q', 'b__q', 'd', 'a__r'])
211-
-> ['a', 'a__q', 'a__r', 'b', 'b__q', 'c', 'c__q', 'd']
212-
"""
213-
if len(lst) <= 2:
214-
return lst
215-
el = lst.pop()
216-
lst = _unite(lst)
217-
if '__' in el:
218-
master = el.split('__')[0]
219-
if not lst[-1].startswith(master):
220-
return _unite(lst[:-1] + [el, lst[-1]])
221-
return lst + [el]
222-
223-
return _unite(list(nx.algorithms.dag.topological_sort(self.subgraph(self.nodes_to_show))))
224-
225200
def _make_graph(self):
226201
"""
227202
Make the self.graph - a graph object ready for drawing

0 commit comments

Comments
 (0)