@@ -22,9 +22,9 @@ import Graphs: attributes, vertex_index
22
22
function attributes (v:: GraphsNode , g:: T ):: AttributeDict where T <: GenericIncidenceList
23
23
AttributeDict (
24
24
" label" => v. dfgNode. label,
25
- " color" => typeof ( v. dfgNode) == DFGVariable ? " red" : " blue" ,
26
- " shape" => typeof ( v. dfgNode) == DFGVariable ? " box" : " ellipse" ,
27
- " fillcolor" => typeof ( v. dfgNode) == DFGVariable ? " red" : " blue"
25
+ " color" => v. dfgNode isa DFGVariable ? " red" : " blue" ,
26
+ " shape" => v. dfgNode isa DFGVariable ? " box" : " ellipse" ,
27
+ " fillcolor" => v. dfgNode isa DFGVariable ? " red" : " blue"
28
28
)
29
29
end
30
30
@@ -226,7 +226,7 @@ List the DFGVariables in the DFG.
226
226
Optionally specify a label regular expression to retrieves a subset of the variables.
227
227
"""
228
228
function ls (dfg:: GraphsDFG , regexFilter:: Union{Nothing, Regex} = nothing ):: Vector{DFGVariable}
229
- variables = map (v -> v. dfgNode, filter (n -> typeof ( n. dfgNode) == DFGVariable, collect ( values ( dfg. g. vertices) )))
229
+ variables = map (v -> v. dfgNode, filter (n -> n. dfgNode isa DFGVariable, vertices ( dfg. g)))
230
230
if regexFilter != nothing
231
231
variables = filter (v -> occursin (regexFilter, String (v. label)), variables)
232
232
end
@@ -247,7 +247,7 @@ List the DFGFactors in the DFG.
247
247
Optionally specify a label regular expression to retrieves a subset of the factors.
248
248
"""
249
249
function lsf (dfg:: GraphsDFG , regexFilter:: Union{Nothing, Regex} = nothing ):: Vector{DFGFactor}
250
- factors = map (v -> v. dfgNode, filter (n -> typeof ( n. dfgNode) == DFGFactor, collect ( values ( dfg. g. vertices) )))
250
+ factors = map (v -> v. dfgNode, filter (n -> n. dfgNode isa DFGFactor, vertices ( dfg. g)))
251
251
if regexFilter != nothing
252
252
factors = filter (f -> occursin (regexFilter, String (f. label)), factors)
253
253
end
321
321
function _copyIntoGraph! (sourceDFG:: GraphsDFG , destDFG:: GraphsDFG , variableFactorLabels:: Vector{Symbol} , includeOrphanFactors:: Bool = false ):: Nothing
322
322
# Split into variables and factors
323
323
verts = map (id -> sourceDFG. g. vertices[sourceDFG. labelDict[id]], variableFactorLabels)
324
- sourceVariables = filter (n -> typeof ( n. dfgNode) == DFGVariable, verts)
325
- sourceFactors = filter (n -> typeof ( n. dfgNode) == DFGFactor, verts)
324
+ sourceVariables = filter (n -> n. dfgNode isa DFGVariable, verts)
325
+ sourceFactors = filter (n -> n. dfgNode isa DFGFactor, verts)
326
326
327
327
# Now we have to add all variables first,
328
328
for variable in sourceVariables
0 commit comments