-
Notifications
You must be signed in to change notification settings - Fork 244
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
delete! for PriorityQueue #344
Conversation
CI is being bad, but this LGTM. |
@oxinabox, it's better if we let CI pass first. While they're not perfect, they're there for a reason--to make sure as much as possible works! If something is broken about CI, it should ideally be fixed, not ignored. In some cases, of course, waiting for CI to pass or fixing problems is not reasonable or possible for any of us (e.g., the latest Julia Windows builds haven't been updated, so the Julia 0.7 Appveyor tests are failing). Anyway, I just restarted the failing job on Travis, which seems to have been a timeout. If that succeeds, it also might fix the coverage issues. |
I agree, and was likewise waiting. (I thought I kicked Travis to retry) We should actually be passing on AppVeyor even with the old 0.7 builds as the version conditional I added to accumulators (which was what was broken) is linked to the exact build number. |
Codecov Report
@@ Coverage Diff @@
## master #344 +/- ##
=========================================
- Coverage 98.65% 96.5% -2.16%
=========================================
Files 30 31 +1
Lines 1716 2286 +570
=========================================
+ Hits 1693 2206 +513
- Misses 23 80 +57
Continue to review full report at Codecov.
|
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.
@scls19fr, unfortunately, this PR needs to be updated for changes in DataStructures. Can you make those changes?
Delete the mapping for the given key in a priority queue, and return the priority queue. | ||
# Examples | ||
```jldoctest | ||
julia> q = PriorityQueue(["a","b","c"],[2,3,1],Base.Order.Forward) |
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.
PriorityQueue
s no longer accept two iterables during construction (matching the corresponding change in other data structures like Dict
s). Some alternatives include
q = PriorityQueue(Base.Order.Forward, "a"=>2, "b"=>3, "c"=>1)
q = PriorityQueue(Base.Order.Forward, zip(["a","b","c"],[2,3,1]))
q = PriorityQueue(zip(["a","b","c"],[2,3,1]), Base.Order.Forward)
q = PriorityQueue(Base.Order.Forward, [("a", 2), ("b", 3), ("c", 1)])
(The same change needs to be made in the docstring for the struct
, if you're up for it.)
@@ -176,6 +176,12 @@ end | |||
@test dequeue_pair!(pq) == ('e'=> 1) | |||
@test dequeue_pair!(pq, 'b') == ('b'=>4) | |||
@test length(pq) == 3 | |||
|
|||
# delete! | |||
pq = PriorityQueue(["a","b","c"],[2,3,1],Base.Order.Forward) |
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.
Same change needed here.
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.
That's sad to see that JuliaDocs/Documenter.jl#527 is not fixed!
We should have been able to catch this kind of error!
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.
Maybe some people at JuliaCon hackaton should try to fix thiss first because that's very annoying not to be able to rely on doctests!
Closed in favor of #428 |
Closes #343