Skip to content

Rename undirected option to add reverse edges#9

Merged
adsharma merged 3 commits into
mainfrom
rename_flag
May 27, 2026
Merged

Rename undirected option to add reverse edges#9
adsharma merged 3 commits into
mainfrom
rename_flag

Conversation

@adsharma

@adsharma adsharma commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Rename the public undirected option to add_reverse_edges / --add-reverse-edges.
  • Preserve directed input by default while allowing explicit reverse-edge expansion.
  • Update docs and tests for CLI, GraphAr conversion, and the in-memory API.

Why

Some input relationships are naturally directed, for example:

user - [:livesin] -> city

That input may be directed, but callers may still want to add reverse edges for algorithms that expect symmetric adjacency, such as community detection, or for databases that prefer this denormalization to answer reverse queries efficiently.

The new name describes the actual behavior: the converter keeps the graph directed by default and only adds reverse edges when explicitly requested.

Validation

  • uv run pytest tests/test_cli.py tests/test_memory.py -q

@adsharma adsharma marked this pull request as ready for review May 27, 2026 02:22
@adsharma adsharma requested a review from Copilot May 27, 2026 02:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the “undirected” option to an explicit reverse-edge expansion option (add_reverse_edges / --add-reverse-edges), keeping graphs directed by default while allowing symmetric adjacency when requested, and updates documentation + tests accordingly.

Changes:

  • Rename the public API/CLI flag from undirected to add_reverse_edges / --add-reverse-edges.
  • Update CSR conversion logic and validations to treat reverse-edge expansion as an explicit opt-in.
  • Update docs/spec and tests, including a new parquet metadata assertion for icebug_disk_version.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_memory.py Updates in-memory API tests to use add_reverse_edges.
tests/test_cli.py Updates CLI conversion tests for new flag; adds parquet metadata assertion.
README.md Updates examples and narrative to describe reverse-edge expansion instead of “undirected”.
icebug_format/memory.py Renames parameter and updates docs/error messaging for reverse-edge expansion.
icebug_format/graphar.py Renames flag and adds reverse-edge expansion + homogeneous-type validation.
icebug_format/cli.py Renames CLI flag and internal parameter; updates help text and messages.
doc/spec.md Updates CLI/spec wording from directed/undirected to direction + reverse edges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread icebug_format/graphar.py
Comment thread icebug_format/graphar.py
@aheev

aheev commented May 27, 2026

Copy link
Copy Markdown
Contributor

there's another problem with providing undirected / rev-edges, direction might not be same across the rel tables. Worth adding it as a caveat

@aheev aheev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread icebug_format/graphar.py
@adsharma adsharma merged commit 1eae71a into main May 27, 2026
1 check passed
@adsharma adsharma deleted the rename_flag branch May 27, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants