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

Gadfly, PyPlot, Winston all don't work with 0.5 dev #14723

Closed
dioptre opened this issue Jan 19, 2016 · 8 comments
Closed

Gadfly, PyPlot, Winston all don't work with 0.5 dev #14723

dioptre opened this issue Jan 19, 2016 · 8 comments

Comments

@dioptre
Copy link

dioptre commented Jan 19, 2016

Getting lots of BoundsErrors

ERROR: BoundsError: attempt to access (1,2,false)

Ie.

julia> using Winston

WARNING: deprecated syntax "AbstractVecOrMat{T} (" at /home/a/.julia/v0.5/Winston/src/Winston.jl:96.
Use "AbstractVecOrMat{T}(" instead.
WARNING: requiring "Dates" in module "Winston" did not define a corresponding module.
WARNING: module Winston should explicitly import * from Base
WARNING: super(T::DataType) is deprecated, use supertype(T) instead.
in depwarn at ./deprecated.jl:73
in super at ./deprecated.jl:50
in iniattr at /home/a/.julia/v0.5/Winston/src/Winston.jl:2677
in call at /home/a/.julia/v0.5/Winston/src/Winston.jl:2676
in call at /home/a/.julia/v0.5/Winston/src/Winston.jl:1038
in include at ./boot.jl:262
in include_from_node1 at ./loading.jl:401
in eval at ./boot.jl:265
[inlined code] from ./sysimg.jl:14
in require at ./loading.jl:332
in eval at ./boot.jl:265
while loading /home/a/.julia/v0.5/Winston/src/Winston.jl, in expression starting on line 2814
WARNING: super(T::DataType) is deprecated, use supertype(T) instead.
in depwarn at ./deprecated.jl:73
in super at ./deprecated.jl:50
in iniattr at /home/a/.julia/v0.5/Winston/src/Winston.jl:2678
in call at /home/a/.julia/v0.5/Winston/src/Winston.jl:2676
in call at /home/a/.julia/v0.5/Winston/src/Winston.jl:1038
in include at ./boot.jl:262
in include_from_node1 at ./loading.jl:401
in eval at ./boot.jl:265
[inlined code] from ./sysimg.jl:14
in require at ./loading.jl:332
in eval at ./boot.jl:265
while loading /home/a/.julia/v0.5/Winston/src/Winston.jl, in expression starting on line 2814

julia> plot([sin(a) for a in 0.0:0.1:2 * pi])
error during Tk callback:
ERROR: BoundsError: attempt to access (1,2,false)
at index [4]
Error showing value of type Winston.FramedPlot:
ERROR: BoundsError: attempt to access (1,2,false)
at index [4]

@tkelman
Copy link
Contributor

tkelman commented Jan 19, 2016

At the moment, unless you can reduce these (see e.g. #14704) to standalone code it's unclear whether the underlying issue is a bug in Base or a bug in these packages. See #14623 (comment) for the underlying cause of the Gadfly issue.

@JeffBezanson
Copy link
Member

I believe this is due to calling Base.Grisu.grisu, which now returns 3 values instead of 4.

@JeffBezanson
Copy link
Member

I didn't realize packages called grisu directly. Hopefully the authors of that code can suggest a number formatting API that would be more useful.

@tkelman
Copy link
Contributor

tkelman commented Jan 19, 2016

Yep: https://github.com/nolta/Winston.jl/blob/808a3182f4622dd7f75925799ee2080f76a4603f/src/Winston.jl#L462

Something about grisu should probably be done in Compat.jl, after we can come up with a suitable API. Both Winston and Showoff look like they're making use of the buffer output that was removed, so not sure what the best approach will be. People had also been taking a look at https://github.com/marcandrysco/Errol recently so it's not unlikely that we might move away from a Grisu-specific implementation at some point.

And JuliaPy/PyPlot.jl#190 should cover PyPlot unless that gets determined to be a base issue.

@JeffBezanson
Copy link
Member

It's easy to patch up by using Base.Grisu.DIGITS as the 4th return value. AFAICT it always returned that object in these use cases.

@alsam
Copy link

alsam commented Jan 20, 2016

Gadfly works ok for me with the patch:

~/.julia/v0.5/Showoff/src$ git diff -u
diff --git a/src/Showoff.jl b/src/Showoff.jl
index 425ca9a..bd95fe1 100644
--- a/src/Showoff.jl
+++ b/src/Showoff.jl
@@ -26,7 +26,9 @@ function grisu(v::AbstractFloat, mode, requested_digits)
         @grisu_ccall v mode requested_digits
         return Base.Grisu.LEN[1], Base.Grisu.POINT[1], Base.Grisu.NEG, Base.Grisu.DIGITS
     else
-        return Base.Grisu.grisu(v, mode, requested_digits)
+        #return Base.Grisu.grisu(v, mode, requested_digits)
+        len, point, neg = Base.Grisu.grisu(v, mode, requested_digits)
+        return len, point, neg, Base.Grisu.DIGITS
     end
 end

@tkelman
Copy link
Contributor

tkelman commented Jan 20, 2016

would need to make that conditional on the julia version number of jeff's commit, otherwise neg would be a tuple on 0.4.

@RaulDurand
Copy link

Any update on PyPlot?

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

No branches or pull requests

5 participants