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

No reduction functions should be column-wise by default (update code and docs) #27532

Closed
Nosferican opened this issue Jun 11, 2018 · 4 comments
Closed
Labels
domain:docs This change adds or pertains to documentation

Comments

@Nosferican
Copy link
Contributor

There still outdated documentation and functions that still have a column-wise by default behavior. These should be updated to taking the dims argument and the documentation should reflect the change.

@Nosferican
Copy link
Contributor Author

Some cases identified,

In Julia, functions such as sort that operate column-wise by default
(sort(A) is equivalent to sort(A,1)) do not have special behavior for 1xN
arrays; the argument is returned unmodified since it still performs sort(A,1).
To sort a 1xN matrix like a vector, use sort(A,2).

@JeffBezanson JeffBezanson added the domain:docs This change adds or pertains to documentation label Jun 11, 2018
@JeffBezanson
Copy link
Sponsor Member

sort does require the dims argument now. I think this is just a doc issue?

@Nosferican
Copy link
Contributor Author

If all functions are have been updated, yes. Is there any reason for why sort API is different from other functions,

using LinearAlgebra
A = rand(3,3)
maximum(A) == maximum(A[:,:])
norm(A) == norm(A[:,:])
mean(A) == mean(A[:,:])

while sort

sort(A)
ERROR: UndefKeywordError: keyword argument dims not assigned

shouldn't it be,

sort(A) == sort(A[:,:])

for consistency?

@JeffBezanson
Copy link
Sponsor Member

Those functions are reductions that have always operated over the whole array, unlike sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

2 participants