JuliaGraphs / JuliaGraphs/Graphs.jl
Convert a Vector{Integer} to Vector{Edge} function
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 538
- Forks
- 128
- Avg merge
- 10h 25m
- Merged PRs (30d)
- 2
Description
Locally I very often use the following function to convert Vectors of Integers to Vector of Edges.
edgeify(p::Vector{T}) where T<:Integer = map(Edge , zip(p, p[2:end]));
As a result it ends up being defined in many local packages.
Do you think it would make sense to have something similar in Graphs.jl ?
Of course it would be nice to probably change the signature to be functional for any E<:AbstractEdge type.
I was also thinking about dispatching the Base.convert function, but maybe we don't want any automatic conversion to take place. What do you think ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Graphs.jl's existing edge types and public API to determine where a vector-to-edge conversion belongs. Compare a dedicated function with dispatching Base.convert, including the proposed AbstractEdge generalization. Done means the project has a decided API and an agreed implementation and test scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100