File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 6565"""
6666import logging
6767import os
68+ import sys
6869import time
6970from collections import defaultdict , namedtuple
7071from io import StringIO
7980
8081log = logging .getLogger (__name__ )
8182
83+
84+ from networkx import DiGraph
85+ if sys .version_info < (3 , 6 ):
86+ """
87+ Consistently ordered variant of :class:`~networkx.DiGraph`.
88+
89+ PY3.6 has inmsertion-order dicts, but PY3.5 has not.
90+ And behvavior *and TCs) in these environments may fail spuriously!
91+ Still *subgraphs* may not patch!
92+
93+ Fix from:
94+ https://networkx.github.io/documentation/latest/reference/classes/ordered.html#module-networkx.classes.ordered
95+ """
96+ from networkx import OrderedDiGraph as DiGraph
97+
98+
8299class DataPlaceholderNode (str ):
83100 """
84101 Dag node naming a data-value produced or required by an operation.
@@ -123,7 +140,7 @@ class Network(plot.Plotter):
123140
124141 def __init__ (self , ** kwargs ):
125142 # directed graph of layer instances and data-names defining the net.
126- self .graph = nx . DiGraph ()
143+ self .graph = DiGraph ()
127144
128145 # this holds the timing information for each layer
129146 self .times = {}
You can’t perform that action at this time.
0 commit comments