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 inexacterrors caused by type coercion in broadcast #885

Merged
merged 1 commit into from
Aug 28, 2016

Conversation

tlnagy
Copy link
Member

@tlnagy tlnagy commented Aug 25, 2016

The following plot fails on master, but is in our documentation:

julia> using Gadfly

julia> plot(x=rand(500), y=rand(1:4, 500), Stat.y_jitter(range=0.5), Geom.point)
Error showing value of type Gadfly.Plot:
ERROR: InexactError()
 in macro expansion at ./broadcast.jl:129 [inlined]
 in macro expansion at ./simdloop.jl:73 [inlined]
 in macro expansion at ./broadcast.jl:123 [inlined]
 in _broadcast!(::Base.#+, ::Array{Int64,1}, ::Tuple{Tuple{Bool},Tuple{Bool}}, ::Tuple{Tuple{Int64},Tuple{Int64}}, ::Tuple{Array{Int64,1},Array{Float64,1}}, ::Type{Val{2}}) at ./broadcast.jl:117
 in broadcast!(::Function, ::Array{Int64,1}, ::Array{Int64,1}, ::Array{Float64,1}) at ./broadcast.jl:172
 in apply_statistic(::Gadfly.Stat.JitterStatistic, ::Dict{Symbol,Gadfly.ScaleElement}, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics) at /Users/tamasnagy/.julia/v0.5/Gadfly/src/statistics.jl:1752
 in apply_statistics(::Array{Gadfly.StatisticElement,1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics) at /Users/tamasnagy/.julia/v0.5/Gadfly/src/statistics.jl:38
 in render_prepare(::Gadfly.Plot) at /Users/tamasnagy/.julia/v0.5/Gadfly/src/Gadfly.jl:740
 in render(::Gadfly.Plot) at /Users/tamasnagy/.julia/v0.5/Gadfly/src/Gadfly.jl:799
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/html")}, ::Gadfly.Plot) at /Users/tamasnagy/.julia/v0.5/Gadfly/src/Gadfly.jl:1062
 in macro expansion at ./multimedia.jl:143 [inlined]
 in display(::Gadfly.Plot) at /Users/tamasnagy/.julia/v0.5/Gadfly/src/Gadfly.jl:1014
 in print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./REPL.jl:154
 in print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./REPL.jl:139
 in (::Base.REPL.##22#23{Bool,Base.REPL.##33#42{Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at ./REPL.jl:652
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at ./LineEdit.jl:1579
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 in run_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at ./REPL.jl:903
 in run_repl(::Base.REPL.LineEditREPL, ::Base.##930#931) at ./REPL.jl:188
 in _start() at ./client.jl:360
 in _start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?

https://dcjones.github.io/Gadfly.jl/stat_y_jitter.html

This PR fixes this problem. Working towards #879.

@coveralls
Copy link

coveralls commented Aug 26, 2016

Coverage Status

Coverage increased (+0.007%) to 65.61% when pulling 7c3590d on tlnagy:fix-broadcast-type-coercion into f6183ac on dcjones:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 65.61% when pulling 7c3590d on tlnagy:fix-broadcast-type-coercion into f6183ac on dcjones:master.

@shashi shashi merged commit 1196f07 into GiovineItalia:master Aug 28, 2016
@tlnagy tlnagy deleted the fix-broadcast-type-coercion branch August 29, 2016 18:18
@tlnagy
Copy link
Member Author

tlnagy commented Aug 29, 2016

Thanks @shashi ! 🎉

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.

3 participants