-
Notifications
You must be signed in to change notification settings - Fork 100
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
base: master
Are you sure you want to change the base?
Conversation
Bump |
the failures seem to be only in JuliaFormating tests. Do you mind running the formater? |
Ok, thats done. I have a few requests:
|
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)? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
I am rerunning the timed-out jobs now. |
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. |
@gdalle , @etiennedeg , @simonschoelly , I am happy to take on some small part of the review and support burden.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I'm also happy to help out a bit, Im committed to some packages building on the graphs ecosystem. |
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. |
src/shortestpaths/bellman-ford.jl
Outdated
) | ||
Base.require_one_based_indexing(all_paths) | ||
Base.require_one_based_indexing(vs) | ||
@assert length(all_paths) == length(vs) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
This PR adds an in-place version of
enumerate_paths
-enumerate_paths!
, thatenumerate_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 ofVector{Int}
whereUnitRange
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)