-
Notifications
You must be signed in to change notification settings - Fork 243
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
Rebase on OrderedCollections #448
Conversation
@@ -4,6 +4,7 @@ version = "0.12.0" | |||
|
|||
[deps] | |||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | |||
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | |||
|
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.
Do we want to set a [compat]
here?
It might make things more orthogonal.
Or it might not
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.
I don't think it's necessary, since the latest tagged version of OrderedCollections works 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.
Since I was making other changes, I added the compat
src/dict_support.jl
Outdated
_tablesz(x::Integer) = x < 16 ? 16 : one(x)<<((sizeof(x)<<3)-leading_zeros(x-1)) | ||
hashindex(key, sz) = (reinterpret(Int,(hash(key))) & (sz-1)) + 1 | ||
|
||
function not_iterator_of_pairs(kv) |
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.
I am not thrilled at the idea of depending on importing this from
OrderedCollections,
because out other dicts need it,
and ideally we'ld be able to cut them out into their own packages,
which would also not depend on OrderedCollections
I see two alternative options.
- just duplicate the code. I don't mind this, while it is not DRY, it does let us evolve the remainind dicts independently of OrderedCollections
- make a micro package DataStructuresUtil.jl or some such, and have both import this.
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.
Interestingly, I think OrderedCollections doesn't even use that function. So I can put it back here and delete it from there.
Codecov Report
@@ Coverage Diff @@
## master #448 +/- ##
==========================================
+ Coverage 98.07% 98.73% +0.65%
==========================================
Files 30 28 -2
Lines 1558 1342 -216
==========================================
- Hits 1528 1325 -203
+ Misses 30 17 -13
Continue to review full report at Codecov.
|
Checking others |
src/DataStructures.jl
Outdated
using InteractiveUtils: methodswith | ||
using OrderedCollections | ||
using OrderedCollections: not_iterator_of_pairs, rehash! | ||
import OrderedCollections: filter, filter!, isordered |
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.
filter
and filter!
both come from Base
Why are they being imported?
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.
Well, they have to be imported because DataStructures extends them. I imported them from OrderedCollections instead of Base due to the Iterators.filter
separation---I basically thought "this should be the same filter
that OrderedCollections uses, whatever version of filter
that is."
src/DataStructures.jl
Outdated
@@ -16,7 +16,9 @@ module DataStructures | |||
eachindex, keytype, valtype | |||
import Base: iterate | |||
|
|||
using InteractiveUtils: methodswith | |||
using OrderedCollections | |||
using OrderedCollections: not_iterator_of_pairs, rehash! |
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.
rehash!
AFAICT is only used by OrderedCollections
so I don't think we need it to be used.
(or did I miss an usage?)
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.
DataStructures.jl/src/dict_sorting.jl
Line 6 in bdd7aa0
rehash!(d) |
DataStructures.jl/src/dict_sorting.jl
Line 16 in bdd7aa0
rehash!(d) |
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.
Ah,
I thought that file had been moved over.
I think it should be moved over.
It uses only Base and OrderedCollections types, no?
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.
Yes, you're absolutely right.
Oddly, these comments only show up if I access this page in certain ways. Weird GitHub bug?
Ok, I am done with my look over. (Complete sidenote; thanks for the recommendation of Gopen and Swan's "The Science of Scientific Writing". I wish I'ld read it at the start of my PhD, but reading it before writing my thesis intro/conclusion is definitely better than never.) |
a573b51
to
64807f6
Compare
Good to go? EDIT: nvm, just noticed your comment above. |
64807f6
to
1d50fce
Compare
@@ -1 +1,2 @@ | |||
julia 0.7 | |||
OrderedCollections 1.0.1 |
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.
Can we just get rid of this file now?
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.
Nope, I checked this morning.
Attobot won't talk to you if you don't have a REQUIRE file.
Good to go? The appveyor failure seems independent. |
Unless there are objections I'm going to merge this soon because in the current situation we are causing problems: see JuliaCollections/OrderedCollections.jl#10 |
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
Thanks! Sorry this took more review from you than it should have. |
This removes the OrderedDict/OrderedSet functionality in favor of the implementation in OrderedCollections. Sorry this took so long.