File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ function _component_hash(c::ComponentModel)
226
226
))
227
227
end
228
228
229
- function Network (vertexfs, edgefs; kwargs... )
229
+ function Network (vertexfs, edgefs; warn_order = true , kwargs... )
230
230
vertexfs = vertexfs isa VertexModel ? [vertexfs] : vertexfs
231
231
edgefs = edgefs isa EdgeModel ? [edgefs] : edgefs
232
232
@argcheck all (has_graphelement, vertexfs) " All vertex models must have assigned `graphelement` to implicitly construct graph!"
@@ -268,7 +268,15 @@ function Network(vertexfs, edgefs; kwargs...)
268
268
end
269
269
270
270
vfs_ordered = [vdict[k] for k in vertices (g)]
271
+ if vfs_ordered != vertexfs && warn_order
272
+ @warn " Order of vertex models was changed to match the natural ordering of vertices in graph! \
273
+ Disable warning with kw `warn_order=false`."
274
+ end
271
275
efs_ordered = [edict[k] for k in edges (g)]
276
+ if efs_ordered != edgefs && warn_order
277
+ @warn " Order of edge models was changed to match the natural ordering edges in graph! \
278
+ Disable warning with kw `warn_order=false`."
279
+ end
272
280
273
281
Network (g, vfs_ordered, efs_ordered; check_graphelement= false , kwargs... )
274
282
end
You can’t perform that action at this time.
0 commit comments