Skip to content

nxadb_to_nx cleanup #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 20, 2024
Merged

nxadb_to_nx cleanup #32

merged 12 commits into from
Aug 20, 2024

Conversation

aMahanna
Copy link
Member

@aMahanna aMahanna commented Aug 15, 2024

  • Optimizing nxadb_to_nx to return the easiest graph whenever possible
  • addresses bug in nxadb_to_nx (and re-addresses test_algorithm assertions because of this)
  • test cleanup

@aMahanna aMahanna marked this pull request as draft August 15, 2024 16:00
@aMahanna aMahanna changed the title attempt: nxadb_to_nx cleanup nxadb_to_nx cleanup Aug 16, 2024
G_NX._node = node_dict

if isinstance(G_NX, nx.DiGraph):
G_NX._succ = G._adj = adj_dict["succ"]
G_NX._succ = G_NX._adj = adj_dict["succ"]
Copy link
Member Author

@aMahanna aMahanna Aug 16, 2024

Choose a reason for hiding this comment

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

this was the bug culprit. I mistakenly overwrote the _adj of the nxadb.Graph object 😨

Comment on lines +140 to +149
# NOTE: At this point, we _could_ choose to implement something similar to
# NodeDict._fetch_all() and AdjListOuterDict._fetch_all() to iterate through
# **node_dict** and **adj_dict**, and establish the "custom" Dictionary classes
# that we've implemented in nx_arangodb.classes.dict.
# However, this would involve adding additional for-loops and would likely be
# slower than the current implementation.
# Perhaps we should consider adding a feature flag to allow users to choose
# between the two methods? e.g `build_remote_dicts=True/False`
# If True, then we would return the (updated) nxadb.Graph that was passed in.
# If False, then we would return the nx.Graph that is built below:
Copy link
Member Author

Choose a reason for hiding this comment

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

this would be an interesting point of discussion to address in a separate PR as an improvement

@aMahanna aMahanna marked this pull request as ready for review August 16, 2024 23:10
@hkernbach hkernbach merged commit b5d94e0 into main Aug 20, 2024
4 checks passed
@aMahanna aMahanna deleted the cleanup-nxadb-to-nx branch August 20, 2024 16:56
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.

2 participants