JuliaGraphs / MetaGraphsNext.jl

A package for graphs with vertex labels and metadata in Julia
http://juliagraphs.org/MetaGraphsNext.jl/
Other
73 stars 17 forks source link

@labels macro #60

Open bramtayl opened 1 year ago

bramtayl commented 1 year ago

Here's one option for making working with labels easier:

Right now we have for example Graphs.outneighbors(meta_graph::MetaGraph, code::Integer) and outneighbor_labels(meta_graph::MetaGraph, label).

Maybe we could have a general pattern where we add a _labels suffix to a Graphs function to make it work with labels instead of code?

We could then have a @labels macro that attaches the _label suffix to all surface-level Graphs function calls?

gdalle commented 1 year ago

Not bad! Related: https://github.com/JuliaGraphs/MetaGraphsNext.jl/issues/59