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)
226226 ))
227227end
228228
229- function Network (vertexfs, edgefs; kwargs... )
229+ function Network (vertexfs, edgefs; warn_order = true , kwargs... )
230230 vertexfs = vertexfs isa VertexModel ? [vertexfs] : vertexfs
231231 edgefs = edgefs isa EdgeModel ? [edgefs] : edgefs
232232 @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...)
268268 end
269269
270270 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
271275 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
272280
273281 Network (g, vfs_ordered, efs_ordered; check_graphelement= false , kwargs... )
274282end
You can’t perform that action at this time.
0 commit comments