Repository navigation
Table sort with a tuple of keys - #4671
Conversation
|
+1 to allowing any iterable |
Use the same test as Table.argsort to convert keys to a list if a string is passed. Otherwise no assumption is made on keys and it can be any iterable.
|
@astrofrog - I changed the test to allow any iterable, the same as |
|
Appveyor failed to install conda, restarting the build. |
|
Up, @astrofrog @taldcroft ? |
|
Needs a change log -- perhaps under "new feature" for 1.2? |
|
@saimn - you should update the doc strings for In theory one could make the input side a bit more tolerant by doing |
|
@taldcroft - About the docstring, it seems redundant to specify 'tuple of str'. The current 'str or list of str' seems enough to me. |
|
Added changelog in 1.2 as suggested by @pllim |
|
@saimn - fair enough. Thanks! |
Currently
Table.sortworks only with a list of keys, so I changed the test to include the possibility to pass a tuple:This is a simple fix for a simple issue, but I wonder if it makes sense to support any kind of iterable (with
utils.isiterable), or to do the same asTable.argsort(which is called bysort), i.e. changing the test to convert the argument to a list if it is a string (and btw it supports any iterable) ?cc @taldcroft