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 65
65
"""
66
66
import logging
67
67
import os
68
+ import sys
68
69
import time
69
70
from collections import defaultdict , namedtuple
70
71
from io import StringIO
79
80
80
81
log = logging .getLogger (__name__ )
81
82
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
+
82
99
class DataPlaceholderNode (str ):
83
100
"""
84
101
Dag node naming a data-value produced or required by an operation.
@@ -123,7 +140,7 @@ class Network(plot.Plotter):
123
140
124
141
def __init__ (self , ** kwargs ):
125
142
# directed graph of layer instances and data-names defining the net.
126
- self .graph = nx . DiGraph ()
143
+ self .graph = DiGraph ()
127
144
128
145
# this holds the timing information for each layer
129
146
self .times = {}
You can’t perform that action at this time.
0 commit comments