Skip to content

Commit 4e94312

Browse files
committed
warn based on object id
1 parent 0f9e944 commit 4e94312

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/construction.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ function Network(vertexfs, edgefs; warn_order=true, 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! \
271+
efs_ordered = [edict[k] for k in edges(g)]
272+
if warn_order && any(vfs_ordered .!== vertexfs)
273+
@warn "Order of vertex models was changed to match the natural ordering of vertices in graph!\
273274
Disable warning with kw `warn_order=false`."
274275
end
275-
efs_ordered = [edict[k] for k in edges(g)]
276-
if efs_ordered != edgefs && warn_order
276+
if warn_order && any(efs_ordered .!== edgefs)
277277
@warn "Order of edge models was changed to match the natural ordering edges in graph! \
278278
Disable warning with kw `warn_order=false`."
279279
end

0 commit comments

Comments
 (0)