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
iterate over last dimension when grouping N-D tables of images #627
Conversation
Derp, this doesn't handle dimensions with length > 2 correctly. Please don't merge yet. |
Ok, fixed. |
src/showmime.jl
Outdated
@@ -48,9 +48,9 @@ end | |||
|
|||
function _show_odd{T<:ColorantArray, N}(io::IO, m::MIME"text/html", imgs::AbstractArray{T, N}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably this needs to be updated to ColorantMatrix
now? (Sorry if I merged the PRs in the wrong order!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I've rebased this branch, so it should be fixed now.
Actually, there's one more issue to resolve: this change results in the table of images being displayed in a row-major ordering, which is inconsistent with the rest of Julia. Let me see if I can fix that... |
src/showmime.jl
Outdated
@@ -48,9 +48,9 @@ end | |||
|
|||
function _show_odd{T<:ColorantMatrix, N}(io::IO, m::MIME"text/html", imgs::AbstractArray{T, N}) | |||
colons = ([Colon() for i=1:(N-1)]...) | |||
for i = 1:size(imgs, 1) | |||
for i = 1:size(imgs, N) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth changing this to for i in indices(imgs, N)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
Oh, never mind; that's clearly the intended behavior, since a vector of images is displayed as a row. |
Thanks! |
Fixes #625 (assuming that that is, in fact, an error).
Before:
After:
My reasoning is that this is more consistent with the way arrays are printed as text in Julia:
gives: