Skip to content
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

Faster uid update function #239

Merged
merged 8 commits into from
Dec 5, 2022
Merged

Faster uid update function #239

merged 8 commits into from
Dec 5, 2022

Conversation

nwlandry
Copy link
Collaborator

@nwlandry nwlandry commented Dec 4, 2022

This PR implements two things:

  • A more efficient function to update the _edge_uid attribute.
  • An improved copy() method (simply copies the _edge_uid counter)

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@nwlandry nwlandry linked an issue Dec 4, 2022 that may be closed by this pull request
xgi/utils/utilities.py Outdated Show resolved Hide resolved
@maximelucas
Copy link
Collaborator

Looks good thank Nich. Any idea how much faster it is?

@nwlandry
Copy link
Collaborator Author

nwlandry commented Dec 5, 2022

Looks good thank Nich. Any idea how much faster it is?

In the add_edges_from function via format5, the methods are almost the same speed, but for add_edge or add_edges_from with format2 or format4, the new way is a lot faster.

@nwlandry nwlandry merged commit 051b706 into main Dec 5, 2022
@nwlandry nwlandry deleted the uid-update branch December 5, 2022 15:35
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.

improve complexity of updating uid
2 participants