-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Make Tests Pass 3.0 #1364
Comments
How would one go about that? tried |
Tried this
Also got some ominous warnings, such as
and
and
|
First of all thanks for your help! |
So I just ran the test from my windows machine and got this: The order of the different VoiceParts is rearranged. What could be the issue here? |
Really not sure why this changed, but the one on the right is the correct one, with the sorted |
The weird thing is that I just ran the tests on my linux pc locally yesterday. With linux I get the right image, with windows the left one. I have no idea, what Travis and Appveyor produce, I just know that the tests fail. Should we maybe drop StatPlots and the related examples from the Plots test suite? |
Feel free to leave out this particular test ( |
In fact JuliaPlots/StatsPlots.jl#95 broke violin and boxplots in other ways as well (JuliaPlots/StatsPlots.jl#121), and IMHO we should revert it and find a different fix for the case of single y values. |
Agreed! Hopefully, this will fix testexample 30, otherwise I'll drop it. Still, this issue had me thinking if maybe we should move the StatsPlots-related test_examples to a seperate test set in StatPlots (this could still use the PlotReferenceImages repo):
It's probably better to keep it as it is. Any opinions? |
OK, I think, I figured it out. On my linux PC, where I run the tests locally, my DataFrames version was stuck at v"0.10.1" because I had ExcelReaders installed. Apparently, with DataFrames >= v"0.11.0" the image on the left in #1364 (comment) is the correct one. So I fixed my local dependency problems and updated the testimages. The tests are passing again! |
Why is the one on the left now the correct one? |
I have no idea. Do you think we should ask the JuliaData people, if this is intended? |
What happens is the following: julia> using RDatasets, Query
julia> singers = RDatasets.dataset("lattice","singer")
julia> v = singers |> @map(_.VoicePart) |> collect;
julia> sort(v)
235-element Array{CategoricalArrays.CategoricalString{UInt8},1}:
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
"Bass 2"
⋮
"Soprano 1"
"Soprano 1"
"Soprano 1"
"Soprano 1"
"Soprano 1"
"Soprano 1"
"Soprano 1"
"Soprano 1"
"Soprano 1" So, once it's passed through the IterableTables machinery, a CategoricalArray sorts in this funny way. Strangely enough, it sorts in the opposite order of appeareance: julia> union(sort(v))
8-element Array{CategoricalArrays.CategoricalString{UInt8},1}:
"Bass 2"
"Bass 1"
"Tenor 2"
"Tenor 1"
"Alto 2"
"Alto 1"
"Soprano 2"
"Soprano 1"
julia> union(v)
8-element Array{CategoricalArrays.CategoricalString{UInt8},1}:
"Soprano 1"
"Soprano 2"
"Alto 1"
"Alto 2"
"Tenor 1"
"Tenor 2"
"Bass 1"
"Bass 2" Trying to sort it before using IterableTables gives error: julia> sort(singers[:VoicePart])
ERROR: ArgumentError: CategoricalValue objects with different pools cannot be tested for order Definitely worth mentioning to the JuliaData people. |
Yes, that isn't the preferred behaviour IMHO. |
Good catch. Sounds like a bug in IterableTables then, which EDIT: the |
I think the iterable tables story should just pass categorical values straight through without doing anything with/to them. I take it that the sort issues is due to something else? Is there anything I should still look into? |
After investigating a bit more, it turns out that the ordering of levels is actually correct, if a bit surprising. It's exactly the same as in R, from low-pitched to high-pitched. So that's a red herring. If you want a different order, just call The only problem here is that the column is turned into an @davidanthoff Would it help if |
I should also have noted that this means that there's no issue regarding Plots.jl AFAICT (it gives the same plot as in R). We can continue discussing semi-related issues elsewhere. |
@nalimilan It is really up to each individual sink what it does when it encounters a I believe StatPlots.jl is using TableTraitsUtils.jl to help with that. One can pass a helper function to the method that is used there that specifies what array type should be used for a given element type. So I think it might be enough if in this line here one would pass a different array factory function than the default one that would create a |
OK, thanks. But the example above did no involve StatPlots at all, so I'm not sure what can be done about it. It sounds like we need a generic API to create the best |
I'm a little confused whether we need to do anything in StatPlots to deal with this? |
I'm not sure. The plot in the OP (with groups in the alphabetical order) is incorrect AFAICT, so if it's the one which is currently produced then there's a bug. OTC, the LHS plot at #1364 (comment) looks correct, so if you get that I think everything is fine. Then there's a possible question about whether StatPlots produces |
Cool, thanks a lot. |
I reread the thread, and all of this has actually nothing to do with iterable tables. The query with the |
Isn't this what I asked above, i.e. would it help if CategoricalArrays overrode |
The tests are failing because of testexample 30. I just recently updated PlotReferenceImages (JuliaPlots/PlotReferenceImages.jl#24) with
Plots.test_examples(:gr, 30)
looking like this:If I run the tests locally on my linux machine (of course) the images for testexample 30 match exactly. However, Travis reports
"Arrays differ. Difference: 0.10048877475329612 eps: 0.1"
.So now I'm confused and wonder if something's wrong with my local setup (but all the other tests pass). It would be great if someone could check and run the tests locally. Is the picture above not how testexample 30 should look?
The text was updated successfully, but these errors were encountered: