You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2019. It is now read-only.
I'm getting a strange error which appears to be an interaction between Gadfly and DataArrays.
Specifically, map! is failing in certain cases, but only when Gadfly is imported.
Here is a simple example (verified using Julia 0.5 on OS X and Linux):
using DataArrays
using Gadfly
functionfoo{S <: Real, T <: Real}(x::AbstractArray{S}, y::AbstractArray{T})
result =DataArray(Float64, length(x))
map!((a, b) -> (isna(a) ||isna(b)) ? NA : a + b, result, x, y)
endfunctionbar{S <: Real, T <: Real}(x::AbstractArray{S}, y::AbstractArray{T})
result =DataArray(Float64, length(x))
map!((a, b) -> a + b, result, x, y)
end
I get the following error:
julia> x =DataArray(1:10)
julia> y =DataArray(fill(1.0, 10))
julia>foo(x, y)
ERROR: TypeError: non-boolean (Bool) used in boolean context
in (::##1#2)(::Int64, ::Float64) at ./REPL[3]:3inmacro expansion at /Users/josh/.julia/v0.5/DataArrays/src/broadcast.jl:59 [inlined]
inmacro expansion at ./cartesian.jl:64 [inlined]
in (::DataArrays.#_F_#203)(::DataArrays.DataArray{Float64,1}, ::DataArrays.DataArray{Int64,1}, ::DataArrays.DataArray{Float64,1}) at /Users/josh/.julia/v0.5/DataArrays/src/broadcast.jl:130inmap!(::Function, ::DataArrays.DataArray{Float64,1}, ::DataArrays.DataArray{Int64,1}, ::DataArrays.DataArray{Float64,1}) at /Users/josh/.julia/v0.5/DataArrays/src/broadcast.jl:214infoo(::DataArrays.DataArray{Int64,1}, ::DataArrays.DataArray{Float64,1}) at ./REPL[3]:3
Note: if Gadfly is not loaded, then the call to foo works as expected with out error (I did say the issue was strange!). The error is also present if Gadfly is imported before DataArrays.
Also, the following calls do work, regardless of whether Gadfly is imported:
I'm getting a strange error which appears to be an interaction between Gadfly and DataArrays.
Specifically,
map!
is failing in certain cases, but only when Gadfly is imported.Here is a simple example (verified using Julia 0.5 on OS X and Linux):
I get the following error:
Note: if Gadfly is not loaded, then the call to
foo
works as expected with out error (I did say the issue was strange!). The error is also present if Gadfly is imported before DataArrays.Also, the following calls do work, regardless of whether Gadfly is imported:
So, it may have something to do with type conversion/promotion (or return type inference?), but as for why/how it involves Gadfly, I have no idea!
The text was updated successfully, but these errors were encountered: