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

Suppress display of module names for invisible types #210

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

kimikage
Copy link
Collaborator

@kimikage kimikage commented Jul 24, 2020

In PR #174 (v0.10.0), the module names were displayed for invisible non-concrete types. In PR #199, non-parametric types also joined the problem. This suppresses the display of module names.

This also completely fixes the problem with display of AGray32. (It was accidentally half-fixed in PR #199.)

julia> import ColorTypes # not `using`

julia> ColorTypes.RGB[] # v0.10.0
0-element Array{ColorTypes.RGB,1} with eltype ColorTypes.RGB

julia> ColorTypes.RGB24[] # v0.10.6
0-element Array{ColorTypes.RGB24,1} with eltype ColorTypes.RGB24

julia> ColorTypes.RGB24[] # this PR
0-element Array{RGB24,1} with eltype ColorTypes.RGB24
julia> AGray32(1) # v0.10.0 or earlier
AGray32{N0f8}(1.0,1.0)

julia> AGray32(1) # v0.10.6 Damn!
AGray32(1.0,1.0)

julia> AGray32(1) # this PR
AGray32(1.0N0f8,1.0N0f8)

@codecov
Copy link

codecov bot commented Jul 24, 2020

Codecov Report

Merging #210 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   93.70%   93.75%   +0.05%     
==========================================
  Files           8        8              
  Lines         699      705       +6     
==========================================
+ Hits          655      661       +6     
  Misses         44       44              
Impacted Files Coverage Δ
src/show.jl 97.36% <100.00%> (+0.49%) ⬆️

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 967cacb...6bc3c52. Read the comment docs.

In PR JuliaGraphics#174 (v0.10.0), the module names were displayed for invisible non-concrete types.
This suppresses the display of module names.
This also completely fixes the problem with display of `AGray32`.
Comment on lines 19 to 26
for i = 1:N
show(io, (comp_n[i])(c))
i == 1 && show(io, comp1(c))
i == 2 && show(io, comp2(c))
i == 3 && show(io, comp3(c))
i == 4 && show(io, comp4(c))
i == 5 && show(io, comp5(c))
print(io, i < N ? ',' : ')') # without spaces
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is compiler-/human-friendly. 😂

@kimikage kimikage merged commit 6d2759c into JuliaGraphics:master Aug 5, 2020
@kimikage kimikage deleted the colorant_string branch August 5, 2020 05:21
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.

2 participants