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

permit more than 256 discrete levels #1186

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

bjarthur
Copy link
Member

@bjarthur bjarthur commented Aug 21, 2018

a partial solution to #1130 (comment)

i still need to run CI, regression, and add a unit test.

src/misc.jl Outdated
discretize_make_ia(values::AbstractVector, levels) =
IndirectArray(Array{UInt8}(indexin(values, levels)), levels)
discretize_make_ia(values::AbstractVector, levels::AbstractVector{T}) where T =
IndirectArray{T,1,AbstractVector{UInt32},AbstractVector{T}}(indexin(values, levels), levels)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't using UInt work here and letting Julia pick the optimal bitstype?

Copy link
Member Author

Choose a reason for hiding this comment

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

UInt is an alias for UInt64

Copy link
Contributor

Choose a reason for hiding this comment

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

The AbstractVector type parameters look weird. Wouldn't IndirectArray{UInt32}(...) be enough here?

@bjarthur
Copy link
Member Author

@andreasnoack @nalimilan could you please review?

CI and regression tests pass. just need to add a test.

@bjarthur
Copy link
Member Author

and @Mattriks , does this PR close #1130 ?

@Mattriks
Copy link
Member

I'm assuming this doesn't fix the first issue: #1130 (comment). That is, where you have a dataset with p levels, but you use the levels arg to specify only q levels where q<p. Did you test with this PR?

@bjarthur
Copy link
Member Author

correct @Mattriks . that's more of a design decision, and i'm just trying to fix the regression you found later.

@codecov-io
Copy link

codecov-io commented Aug 24, 2018

Codecov Report

Merging #1186 into master will not change coverage.
The diff coverage is 91.76%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1186   +/-   ##
=======================================
  Coverage   87.28%   87.28%           
=======================================
  Files          34       34           
  Lines        4049     4049           
=======================================
  Hits         3534     3534           
  Misses        515      515
Impacted Files Coverage Δ
src/Gadfly.jl 79.04% <ø> (ø) ⬆️
src/data.jl 0% <ø> (ø) ⬆️
src/aesthetics.jl 82.35% <ø> (ø) ⬆️
src/varset.jl 100% <100%> (ø) ⬆️
src/geom/line.jl 98.07% <100%> (ø) ⬆️
src/ticks.jl 92.08% <100%> (ø) ⬆️
src/geom/hvabline.jl 94.11% <100%> (ø) ⬆️
src/geom/polygon.jl 66.66% <100%> (ø) ⬆️
src/scale.jl 88.26% <100%> (ø) ⬆️
src/misc.jl 51.87% <100%> (ø) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7a1b32...46e854f. Read the comment docs.

@nalimilan
Copy link
Contributor

@bjarthur Have you noticed my comment?

@Mattriks
Copy link
Member

Mattriks commented Aug 24, 2018

The issue for me is that the ability to specify fewer levels than available levels worked in Gadfly 0.6.5, but doesn't work on master. As #1130 (comment) does not work on master than this statement in the docs:
"Order will be respected and anything in the data that's not represented in levels will be set to missing." needs to say :
"Order will be respected but attempting to set select fewer levels than available levels is currently not working."
Note: the former statement occurs twice in the docs.

@bjarthur
Copy link
Member Author

@nalimilan i did, yes. turns out UInt32 wasn't needed at all. rather just the removal of UInt8 fixed the InexactError that was thrown by the tessellation example.

note that this PR uses a boiled down test which only captures the InexactError. still not fixed are the unfilled polygon's in that same example.

plan is to merge this once CI passes and then start working on 0.7, which is the most pressing issue now in my mind.

@bjarthur bjarthur merged commit f8ec8ff into GiovineItalia:master Aug 28, 2018
@bjarthur bjarthur deleted the bja/uint32 branch August 28, 2018 02:11
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.

5 participants