Skip to content

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

Merged
merged 1 commit into from
Jan 5, 2017
Merged

Update Terms for Julia 0.6 changes #11

merged 1 commit into from
Jan 5, 2017

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented Jan 5, 2017

This does a couple of things:

  • tt is inferred as Array{Any,1}, as is tt .== 1, so !(tt .== 1) fails. Changed to filter!.
  • Vectorized | is deprecated and .| doesn't exist in 0.5. Changed to map.

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))
Copy link
Member

@andreasnoack andreasnoack Jan 5, 2017

Choose a reason for hiding this comment

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

bitbroadcast?

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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}.

Copy link
Member

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}

@codecov-io
Copy link

codecov-io commented Jan 5, 2017

Current coverage is 95.10% (diff: 100%)

Merging #11 into master will increase coverage by 1.53%

@@             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          

Powered by Codecov. Last update 1e86a5b...209c08a

@ararslan
Copy link
Member Author

ararslan commented Jan 5, 2017

Any objection to merging this as-is, @andreasnoack?

@andreasnoack andreasnoack merged commit 00d4761 into master Jan 5, 2017
@andreasnoack andreasnoack deleted the aa/terms-0.6 branch January 5, 2017 21:40
@ararslan
Copy link
Member Author

ararslan commented Jan 5, 2017

I'll take that as a "no" 😄

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