-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP: max/min -> maxof/minof #2419
Conversation
Whoops, forgot about extras/. I'll fix that in a minute. |
Woah. This is a surprisingly large change. That's not necessarily bad but it definitely needs to sit for a bit and collect some commentary. |
The size of this change reflects that |
Well, we only need max/min on a dimension for non-scalar arguments. So, the other option is to make |
I prefer that |
See this is where it gets kind of ugly. Since max and min have this problem and they're in some sense related to mean and median (as statistics one can take of a set of values), it gets kind of weird that some statistics can take a dim argument and some can't. Using a |
Unfortunately, there's a reason why this issue hasn't been satisfactorily resolved yet :-\ |
@tshort I prefer that functionality in a statement like |
The code is actually a lot more readable now. |
@tshort Having ruminated on this for a day, I see now why your |
Implements the renaming of the binary max/min functions to
maxof
andminof
as discussed in #2265. Now, ifmax
ormin
are given a second argument, it is interpreted as the dimension or region over which to take the max or min.Bye,
max(a, (), 1)
!Note: this required updates in a lot of files. It passes all tests on my machine, but additional testing might be wise before merging.