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

fix deprecated array constructors #348

Merged
merged 1 commit into from
Dec 6, 2017

Conversation

fredrikekre
Copy link
Member

No description provided.

@fredrikekre
Copy link
Member Author

Waiting for JuliaLang/METADATA.jl#12295

@fredrikekre fredrikekre closed this Dec 1, 2017
@fredrikekre fredrikekre reopened this Dec 1, 2017
@fredrikekre
Copy link
Member Author

This will fail because of JuliaLang/Compat.jl#416 (comment)

@fredrikekre fredrikekre force-pushed the fe/uninitialized branch 3 times, most recently from 56a125b to 64026e8 Compare December 2, 2017 16:18
@fredrikekre
Copy link
Member Author

Well, tests pass on 0.6 now, but KeyIterator has changed to KeySet on master...

@codecov
Copy link

codecov bot commented Dec 2, 2017

Codecov Report

Merging #348 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #348      +/-   ##
=========================================
+ Coverage   96.45%   96.5%   +0.04%     
=========================================
  Files          31      31              
  Lines        2286    2287       +1     
=========================================
+ Hits         2205    2207       +2     
+ Misses         81      80       -1
Impacted Files Coverage Δ
src/sorted_dict.jl 98.31% <ø> (ø) ⬆️
src/delegate.jl 40% <ø> (ø) ⬆️
src/sorted_multi_dict.jl 92.92% <ø> (ø) ⬆️
src/DataStructures.jl 100% <ø> (+11.11%) ⬆️
src/classified_collections.jl 85.71% <100%> (ø) ⬆️
src/priorityqueue.jl 99.13% <100%> (ø) ⬆️
src/int_set.jl 100% <100%> (ø) ⬆️
src/balanced_tree.jl 100% <100%> (ø) ⬆️
src/circ_deque.jl 100% <100%> (ø) ⬆️
src/heaps.jl 100% <100%> (ø) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8aa166e...ef72847. Read the comment docs.

@fredrikekre fredrikekre force-pushed the fe/uninitialized branch 2 times, most recently from 576807a to fd742b0 Compare December 3, 2017 09:18
@oxinabox
Copy link
Member

oxinabox commented Dec 6, 2017

Needs to be rebased as of #349 which is a rough subset of these changes.
(My bad, I though that this was blocked waiting for #349, not that they directly overlapped)

@martinholters
Copy link
Contributor

Ooops, yes, sorry, I had missed that you had updated this PR, too.

@static if VERSION < v"0.7.0-DEV.2437"
_include_string(str) = eval(parse(str))
else
_include_string(str) = eval(Meta.parse(str))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be used unconditionally, because Meta.parse is available on 0.6, too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, right.

@fredrikekre fredrikekre force-pushed the fe/uninitialized branch 2 times, most recently from 07d19a6 to aa3460b Compare December 6, 2017 09:48
@fredrikekre
Copy link
Member Author

Rebased and removed the KeySet stuff from this PR.

Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

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

Nothing looks egregious.

_oldOrderedDict1 = "OrderedDict{V}(kv::Tuple{Vararg{Pair{TypeVar(:K),V}}}) = OrderedDict{Any,V}(kv)"
_newOrderedDict1 = "OrderedDict{V}(kv::Tuple{Vararg{Pair{K,V} where K}}) = OrderedDict{Any,V}(kv)"
_oldOrderedDict1 = "OrderedDict(kv::Tuple{Vararg{Pair{TypeVar(:K),V}}}) where {V} = OrderedDict{Any,V}(kv)"
_newOrderedDict1 = "OrderedDict(kv::Tuple{Vararg{Pair{K,V} where K}}) where {V} = OrderedDict{Any,V}(kv)"
OrderedDict(kv::Tuple{Vararg{Pair{K,V}}}) where {K,V} = OrderedDict{K,V}(kv)
OrderedDict(kv::Tuple{Vararg{Pair{K}}}) where {K} = OrderedDict{K,Any}(kv)
VERSION < v"0.6.0-dev.2123" ? _include_string(_oldOrderedDict1) : _include_string(_newOrderedDict1)
Copy link
Member

Choose a reason for hiding this comment

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

Julia <0.6 release is not supported, so this stuff can go, and just the real code can be put in.

_oldOrderedDict2 = "OrderedDict{V}(ps::Pair{TypeVar(:K),V}...,) = OrderedDict{Any,V}(ps)"
_newOrderedDict2 = "OrderedDict{V}(ps::(Pair{K,V} where K)...,) = OrderedDict{Any,V}(ps)"
_oldOrderedDict2 = "OrderedDict(ps::Pair{TypeVar(:K),V}...,) where {V} = OrderedDict{Any,V}(ps)"
_newOrderedDict2 = "OrderedDict(ps::(Pair{K,V} where K)...,) where {V} = OrderedDict{Any,V}(ps)"
OrderedDict(ps::Pair{K,V}...) where {K,V} = OrderedDict{K,V}(ps)
OrderedDict(ps::Pair{K}...,) where {K} = OrderedDict{K,Any}(ps)
VERSION < v"0.6.0-dev.2123" ? _include_string(_oldOrderedDict2) : _include_string(_newOrderedDict2)
Copy link
Member

Choose a reason for hiding this comment

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

same

@test findfirst(s,2) == 0
@test findfirst(equalto(1), s) == 1
@test findfirst(equalto(7), s) == 4
@test findfirst(equalto(2), s) == 0
Copy link
Member

Choose a reason for hiding this comment

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

I guess these are coming in from Compat ?
It is a nice feature

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, JuliaLang/julia#23812 on master and JuliaLang/Compat.jl#405 in Compat.

  - use uninitialized for Array and BitArray constructors
  - parse -> Meta.parse
  - findfirst(x, v) -> findfirst(equalto(v), x)
  - some syntax deprecation warnings for parametric methods
@fredrikekre
Copy link
Member Author

Removed the old code, which lets us remove the _include_string definition as well.

@ararslan ararslan merged commit 2f64978 into JuliaCollections:master Dec 6, 2017
@fredrikekre fredrikekre deleted the fe/uninitialized branch December 6, 2017 19:12
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