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

Support (c)transpose #42

Merged
merged 1 commit into from
Sep 19, 2016
Merged

Support (c)transpose #42

merged 1 commit into from
Sep 19, 2016

Conversation

timholy
Copy link
Member

@timholy timholy commented Sep 19, 2016

Together with the prior addition of permutedims, this closes one of the Roadmap (#7) items.

@@ -35,6 +37,17 @@ for perm in ((:col, :row, :page), (:col, :page, :row),
(:row, :page, :col), (:row, :col, :page))
@test axisnames(permutedims(A, perm)) == perm
end
@test axisnames(permutedims(A, (:col,))) == (:col, :row, :page)
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this test and the next to highlight a somewhat non-obvious feature of the permutation algorithm: any dimensions that aren't listed explicitly get appended, in the order in which they appear. This was useful for me at one point in Images (that's where this was effectively copied from), but I'm not sure it's necessary now and in any event I recognize it could be a bit controversial. So I wanted to air the (potentially) dirty laundry; if you don't like it, I can pull these tests and modify the algorithm to be more strict about its inputs.

Copy link
Member

Choose a reason for hiding this comment

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

That's not terribly different than the way indexing works. If you index with named axes, the other dimensions are filled with :. I agree it's a little marginal, but it doesn't seem objectionable.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, let's keep it then.

@timholy timholy merged commit 05ca4ae into master Sep 19, 2016
@timholy timholy deleted the teh/transpose branch September 19, 2016 16:42
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