Skip to content

[GA-153-1] Implement EdgeAttrDict update method (new) #30

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 41 commits into from
Aug 20, 2024

Conversation

hkernbach
Copy link
Member

This PR replaces: #15

@hkernbach hkernbach changed the title Feature/edge attr dict [GA-153-1] Implement EdgeAttrDict update method (new) Aug 15, 2024
@hkernbach hkernbach changed the base branch from main to feature/node-dict August 15, 2024 14:44
@hkernbach hkernbach requested a review from aMahanna August 15, 2024 17:30
@hkernbach hkernbach marked this pull request as ready for review August 15, 2024 17:30
@aMahanna
Copy link
Member

aMahanna commented Aug 15, 2024

@hkernbach I'm just realizing now that in order for users to do something like this:

G.adj.update(...)

We'll need to create a CustomAdjacencyView that inherits from this: https://github.com/networkx/networkx/blob/main/networkx/classes/coreviews.py#L66-L85

So similar to the setup we have for CustomNodeView: https://github.com/arangodb/nx-arangodb/blob/main/nx_arangodb/classes/reportviews.py#L13-L22

NetworkX doesn't recommend users to directly access the _node or _adj objects directly, so we'll need to provide these custom views to act as wrappers around the update methods we're introducing

This will warrant creating a coreviews.py file in nx_arangodb/classes

@hkernbach
Copy link
Member Author

@hkernbach I'm just realizing now that in order for users to do something like this:

G.adj.update(...)

We'll need to create a CustomAdjacencyView that inherits from this: https://github.com/networkx/networkx/blob/main/networkx/classes/coreviews.py#L66-L85

So similar to the setup we have for CustomNodeView: https://github.com/arangodb/nx-arangodb/blob/main/nx_arangodb/classes/reportviews.py#L13-L22

NetworkX doesn't recommend users to directly access the _node or _adj objects directly, so we'll need to provide these custom views to act as wrappers around the update methods we're introducing

This will warrant creating a coreviews.py file in nx_arangodb/classes

Please let's discuss this next. This is not yet clear to me

@hkernbach hkernbach changed the base branch from feature/node-dict to main August 16, 2024 14:28
Comment on lines 771 to 774
if (
graph_type == GraphType.Graph.name
or graph_type == GraphType.DiGraph.name
):
Copy link
Member

Choose a reason for hiding this comment

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

could we extract this boolean check out of the double for loop given that graph_type is constant throughout this function?

Copy link
Member Author

Choose a reason for hiding this comment

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

done in da332e0

@hkernbach hkernbach merged commit 5b72482 into main Aug 20, 2024
4 checks passed
@aMahanna aMahanna deleted the feature/edge-attr-dict branch August 20, 2024 12:29
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