File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 321
321
322
322
copy (g:: T ) where {T<: MetaGraph } = deepcopy (g)
323
323
324
+ """
325
+ code_for(meta::MetaGraph, vertex_label)
326
+
327
+ Find the code for associated with a vertex with `vertex_label`. This can be useful to pass
328
+ to methods inherited from `LightGraphs`. Note, however, that vertex codes could be
329
+ reassigned after vertex deletion.
330
+
331
+ ```jldoctest
332
+ julia> using MetaGraphsNext
333
+
334
+ julia> using LightGraphs: Graph
335
+
336
+ julia> meta = MetaGraph(Graph());
337
+
338
+ julia> meta[:a] = nothing
339
+
340
+ julia> code_for(meta, :a)
341
+ 1
342
+ ```
343
+ """
344
+ function code_for (meta:: MetaGraph , vertex_label)
345
+ code, _ = meta. vprops[vertex_label]
346
+ code
347
+ end
348
+ export code_for
349
+
324
350
include (" metadigraph.jl" )
325
351
include (" overrides.jl" )
326
352
include (" persistence.jl" )
You can’t perform that action at this time.
0 commit comments