Pometry / Pometry/Raphtory

Possible improvements for interaction with edge properties in to_networkx

Open
#1,576 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Connector Python
Dominant language
Rust
Stars
642
Forks
70
Avg merge
2d 13h
Merged PRs (30d)
21

Description

Currently if you have a raphtory graph with edge properties and map it to a networkx graph, the properties are in a new map with keys "constant" or "temporal". Upon selecting temporal, the value of each is returned as a list of k,v tuples rather than a dict which makes accessing the value of one property a bit clunky, e.g. if you call g.edges.data("temporal") it might look like this for one edge.

('node_a', 'node_b', [('boolean_prop', [(1465088400000, True)])])

Could this be changed to be a dict? I.e.

('node_a', 'node_b', {'boolean_prop' : [(1465088400000, True)]})

Even better, I believe the old version of to_networkx (when it was in python before rust), when you set explode_edges to true would return multiple edges each with just one flat property with that name, so that upon calling g.edges.data("boolean_prop") it would return something like

('node_a', 'node_b', (1465088400000, True))

since each exploded edge has just one temporal property update. Would it be possible to have something like this again?

Happy to expand or help make the fix :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the to_networkx entry point and inspect how temporal and constant edge-property maps are produced, including the explode_edges path. Compare the current edge-data shape with the two representations requested in the issue. Done means the chosen representation is implemented and covered by tests for temporal properties and exploded edges.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
backend-api-design, data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.