Skip to content

Commit c88784a

Browse files
Simplify logic.
1 parent 489cef4 commit c88784a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datajoint/diagram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ def _make_graph(self):
230230
# mark "distinguished" tables, i.e. those that introduce new primary key attributes
231231
for name in self.nodes_to_show:
232232
foreign_attributes = set(attr for p in self.in_edges(name, data=True) for attr in p[2]['attr_map'])
233-
self.node[name]['distinguished'] = (foreign_attributes < self.node[name]['primary_key']
234-
if ('primary_key' in self.node[name].keys()) else False)
233+
self.node[name]['distinguished'] = ('primary_key' in self.node[name] and
234+
foreign_attributes < self.node[name]['primary_key'])
235235
# include aliased nodes that are sandwiched between two displayed nodes
236236
gaps = set(nx.algorithms.boundary.node_boundary(self, self.nodes_to_show)).intersection(
237237
nx.algorithms.boundary.node_boundary(nx.DiGraph(self).reverse(), self.nodes_to_show))

0 commit comments

Comments
 (0)