Skip to content

add non-allocating enumerate_paths! #428

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rafaqz
Copy link

@rafaqz rafaqz commented Apr 13, 2025

This PR adds an in-place version of enumerate_paths - enumerate_paths!, that enumerate_paths now calls itself after making the required allocations.

This can greatly improve performance where you need to call it many times. I also removed allocations in enumerate_paths functions, such as allocations of Vector{Int} where UnitRange works fine in its place.

(This may need a specific test, although it will run in the current tests anyway - I can write that if its considered to be merged)

@rafaqz
Copy link
Author

rafaqz commented May 2, 2025

Bump

@Krastanov
Copy link
Member

the failures seem to be only in JuliaFormating tests. Do you mind running the formater?

@rafaqz
Copy link
Author

rafaqz commented May 9, 2025

Ok, thats done.

I have a few requests:

  • please remove the need for approval to run workflows in the github settings
  • please, lets remove this formatter check. Formatter could be run by julia-format to make its own PR, instead of blocking contributions without perfect formatting

@Krastanov
Copy link
Member

I am not really a core part of the team, so I can not address these requests, but I am in favor of the changes you are requesting. @gdalle , are you a good person to tag on this (see previous comment)?

Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.31%. Comparing base (2ae1c18) to head (057d7ed).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #428   +/-   ##
=======================================
  Coverage   97.30%   97.31%           
=======================================
  Files         117      117           
  Lines        6948     6962   +14     
=======================================
+ Hits         6761     6775   +14     
  Misses        187      187           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Krastanov
Copy link
Member

I am rerunning the timed-out jobs now.

@gdalle
Copy link
Member

gdalle commented May 14, 2025

Sorry @Krastanov, as I announced on Slack and Discourse a while back, I have decided to retreat from JuliaGraphs maintenance tasks. I already have much on my plate with the JuliaDiff ecosystem, so it wouldn't be fair to pretend that I can take care of a second large project.
Unfortunately I don't know who's active around here anymore. Perhaps @etiennedeg or @simonschoelly?

@Krastanov
Copy link
Member

@gdalle , @etiennedeg , @simonschoelly , I am happy to take on some small part of the review and support burden.

  • if there is already very little support for this package, it might make sense to relax some of the contribution requirements (e.g. formatting in a particular style)
  • what are the rules for adding contributors to the team (like the author of this PR) so that running tests and other similar issues are not blocked on a volunteer remembering to enable something
  • who are the current decision makers for this github organization
  • may I get higher level access to the org (e.g. so that I can add community members to the team)
  • I will copy this on slack so that we do not pollute the PR discussion page

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

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

lgtm

@rafaqz
Copy link
Author

rafaqz commented May 14, 2025

I'm also happy to help out a bit, Im committed to some packages building on the graphs ecosystem.

@Krastanov
Copy link
Member

Thanks! You were added to the list of maintainers! I have left a review approving of a merge, so the merge option should now be unlocked for you. Please feel free to squash and merge unless there are other changes you would like to discuss.

)
Base.require_one_based_indexing(all_paths)
Base.require_one_based_indexing(vs)
@assert length(all_paths) == length(vs)
Copy link
Member

Choose a reason for hiding this comment

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

From the documentation:

Warning

An assert might be disabled at some optimization levels.
Assert should therefore only be used as a debugging tool and
not used for authentication verification (e.g., verifying
passwords or checking array bounds). The code must not rely
on the side effects of running cond for the correct behavior
of a function.

Copy link
Author

Choose a reason for hiding this comment

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

Ok this is now an ArgumentError instead, and I've tested expliticly calling enumerate_paths! with both correct and incorrect length inputs so its also tested

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.

4 participants