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

Do not print delimiters twice in show(::OffsetMatrix) for matrices with certain shifted axes #39522

Merged
merged 4 commits into from
Feb 9, 2021

Conversation

jishnub
Copy link
Contributor

@jishnub jishnub commented Feb 4, 2021

Currently the _show_nonempty method for an AbstactMatrix had some assumptions about 1-based indexing that did not hold true for OffsetArrays. This led to outputs such as

julia> X = OffsetArray(reshape(1:3, 3, 1), -1:1, 0:0);

julia> show(X)
[1; ; 2; ; 3]

This PR attempts to fix the double delimiters. After this:

julia> show(X)
[1; 2; 3]

and in general show(X) should be identical to show(parent(X))

@jishnub jishnub changed the title Fix show for OffsetMatrix Do not print delimiters twice in show(::OffsetMatrix) for matrices with certain shifted axes Feb 4, 2021
@jishnub jishnub closed this Feb 4, 2021
@jishnub jishnub reopened this Feb 4, 2021
base/arrayshow.jl Outdated Show resolved Hide resolved
@kshyatt kshyatt added the display and printing Aesthetics and correctness of printed representations of objects. label Feb 6, 2021
@jishnub
Copy link
Contributor Author

jishnub commented Feb 7, 2021

Test failure seems unrelated

@jishnub jishnub closed this Feb 8, 2021
@jishnub jishnub reopened this Feb 8, 2021
@timholy timholy merged commit 2155772 into JuliaLang:master Feb 9, 2021
@timholy timholy added the backport 1.6 Change should be backported to release-1.6 label Feb 9, 2021
@jishnub jishnub deleted the showoffsetmatrix branch February 9, 2021 09:50
KristofferC pushed a commit that referenced this pull request Feb 11, 2021
…th certain shifted axes (#39522)

(cherry picked from commit 2155772)
@KristofferC KristofferC mentioned this pull request Feb 11, 2021
52 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Mar 14, 2021
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
…th certain shifted axes (#39522)

(cherry picked from commit 2155772)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants