dlcole3 / DataGraphs.jl

MIT License
0 stars 0 forks source link

Added API for getting sets of data and for ordering edges #36

Closed dlcole3 closed 1 year ago

dlcole3 commented 1 year ago

Addd get_node_data and get_edge_data functions for getting full matrices or vectors of data from the NodeData and EdgeData.

Currently, edges are added to the dg.edges vector in the order they are passed to the add_edge! function. However, in some cases, it is valuable to sort the edges by what node they correspond to (i.e., edges connected to dg.nodes[1] show up first, followed by dg.nodes[2], etc.). For example, this is useful in GNNs, which might take a SimpleGraph object and construct the edges in the order they appear. I added functions order_edges! which rearranges the order of the edges in place, and I added aget_ordered_edge_data` set of functions for returning the matrix/vector in the desired order.

codecov[bot] commented 1 year ago

Codecov Report

Merging #36 (da95ea3) into main (136750a) will decrease coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
- Coverage   93.58%   93.55%   -0.04%     
==========================================
  Files           9        9              
  Lines        1716     1692      -24     
==========================================
- Hits         1606     1583      -23     
+ Misses        110      109       -1     
Impacted Files Coverage Δ
src/DataGraphs.jl 100.00% <ø> (ø)
src/datadigraphs/interface.jl 100.00% <ø> (ø)
src/datagraphs/interface.jl 100.00% <ø> (ø)
src/datadigraphs/core.jl 95.20% <100.00%> (-0.84%) :arrow_down:
src/datadigraphs/utils.jl 97.21% <100.00%> (ø)
src/datagraphs/core.jl 87.25% <100.00%> (-2.44%) :arrow_down:
src/datagraphs/utils.jl 91.79% <100.00%> (ø)
src/functions.jl 94.24% <100.00%> (+1.71%) :arrow_up:
src/interface.jl 97.67% <100.00%> (+0.70%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.