`trim1` and 'trimboth' backwards incompatible change

Hello all, `trim1` and `trimboth` currently trim items from one or both tails (respectively) of an array_like input but they do so without sorting the items. It has been discussed that a function such as that does not make much sense so that behaviour is being changed. Now the items will be sorted prior to trimming. As any other backwards incompatible change, we would like to hear if anyone has an opinion on this matter before we commit to it. You can find the changes in PR 4910 <https://github.com/scipy/scipy/pull/4910> Regards, Abraham.

Abraham Escalante <aeklant@gmail.com> wrote:
Hello all,
`trim1` and `trimboth` currently trim items from one or both tails (respectively) of an array_like input but they do so without sorting the items. It has been discussed that a function such as that does not make much sense so that behaviour is being changed. Now the items will be sorted prior to trimming.
Wouldn't it be sufficient to do partial sorting (cf. numpy.partition)? Sturla

Yes. I have made the change to partially sort (and just keep full sorting for numpy < 1.8.0). If anyone has other observations, please feel free to mention them. Here is the PR again: 4910 <https://github.com/scipy/scipy/pull/4910> Cheers, Abraham. 2015-06-11 6:31 GMT-05:00 Sturla Molden <sturla.molden@gmail.com>:
Abraham Escalante <aeklant@gmail.com> wrote:
Hello all,
`trim1` and `trimboth` currently trim items from one or both tails (respectively) of an array_like input but they do so without sorting the items. It has been discussed that a function such as that does not make much sense so that behaviour is being changed. Now the items will be sorted prior to trimming.
Wouldn't it be sufficient to do partial sorting (cf. numpy.partition)?
Sturla
_______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev

On Tue, Jun 9, 2015 at 6:18 AM, Abraham Escalante <aeklant@gmail.com> wrote:
Hello all,
`trim1` and `trimboth` currently trim items from one or both tails (respectively) of an array_like input but they do so without sorting the items. It has been discussed that a function such as that does not make much sense so that behaviour is being changed. Now the items will be sorted prior to trimming.
As any other backwards incompatible change, we would like to hear if anyone has an opinion on this matter before we commit to it.
Okay, it's been 5 days without objection so we'll move forward with this PR. Ralf

Am 09.06.2015 um 06:18 schrieb Abraham Escalante:
Hello all,
`trim1` and `trimboth` currently trim items from one or both tails (respectively) of an array_like input but they do so without sorting the items. It has been discussed that a function such as that does not make much sense so that behaviour is being changed. Now the items will be sorted prior to trimming.
As any other backwards incompatible change, we would like to hear if anyone has an opinion on this matter before we commit to it.
+100, due to this thread i found some serious bugs in my code which assumed trim_both sorted the array. Till
participants (4)
-
Abraham Escalante
-
Ralf Gommers
-
Sturla Molden
-
Till Stensitzki