Skip to content

Commit 76d40ae

Browse files
improve comments in topological sort
1 parent 224785e commit 76d40ae

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

datajoint/dependencies.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def topo_sort(graph):
4242
if (master := extract_master(part)) in graph:
4343
for edge in graph.in_edges(part):
4444
parent = edge[0]
45-
if parent != master and extract_master(parent) != master:
45+
if master not in (parent, extract_master(parent)):
46+
# if parent is neither master nor part of master
4647
graph.add_edge(parent, master)
4748
sorted_nodes = list(nx.topological_sort(graph))
4849

datajoint/diagram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Diagram(nx.DiGraph):
7171
Only those tables that are loaded in the connection object are displayed
7272
"""
7373

74-
def __init__(self, source=None, context=None):
74+
def __init__(self, source, context=None):
7575

7676
if isinstance(source, Diagram):
7777
# copy constructor

0 commit comments

Comments
 (0)