-
Notifications
You must be signed in to change notification settings - Fork 33
Update Terms for Julia 0.6 changes #11
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
Conversation
tt = tt[!(tt .== 1)] # drop any explicit 1's | ||
noint = (tt .== 0) | (tt .== -1) # should also handle :(-(expr,1)) | ||
filter!(t -> t != 1, tt) # drop any explicit 1's | ||
noint = BitArray(map(t -> t == 0 || t == -1, tt)) # should also handle :(-(expr,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.
bitbroadcast
?
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.
Looks nifty but is apparently deprecated in 0.6
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. So broadcast
(but not map
) will figure out that the return array should be BitArray
.
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 will still fail the currently failing test because broadcast(t -> t == 1, tt)
doesn't produce an empty BitArray
if tt
is empty; it produces Array{Any,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.
I think JuliaLang/julia#19854 fixed this. On latest master:
julia> broadcast(t -> t == 1, Float64[])
0-element BitArray{1}
Current coverage is 95.10% (diff: 100%)@@ master #11 diff @@
==========================================
Files 5 5
Lines 311 347 +36
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 291 330 +39
+ Misses 20 17 -3
Partials 0 0
|
Any objection to merging this as-is, @andreasnoack? |
I'll take that as a "no" 😄 |
This does a couple of things:
tt
is inferred asArray{Any,1}
, as istt .== 1
, so!(tt .== 1)
fails. Changed tofilter!
.|
is deprecated and.|
doesn't exist in 0.5. Changed tomap
.