[Numpy-discussion] Added atleast_nd, request for clarification/cleanup of atleast_3d

Joseph Fox-Rabinovitz jfoxrabinovitz at gmail.com
Wed Jul 6 14:21:44 EDT 2016


I still think this function is useful. I have made a change so that it
only accepts one array, as Marten suggested, making the API much
cleaner than that of its siblings. The side on which the new
dimensions will be added is configurable via the `where` parameter,
which currently accepts 'before' and 'after', but can be changed to
accept sequences or even dicts. The change also resulted in finding a
bug in the masked array versions of the atleast functions, which the
PR now fixes and adds regression tests for. If the devs do decide to
discard this PR, I will of course submit the bug fix separately.

    -Joe

On Wed, Jul 6, 2016 at 1:43 PM, Stephan Hoyer <shoyer at gmail.com> wrote:
> On Tue, Jul 5, 2016 at 10:06 PM, Nathaniel Smith <njs at pobox.com> wrote:
>>
>> I don't know how typical I am in this. But it does make me wonder if the
>> atleast_* functions act as an attractive nuisance, where new users take
>> their presence as an implicit recommendation that they are actually a useful
>> thing to reach for, even though they... aren't that. And maybe we should be
>> recommending folk move away from them rather than trying to extend them
>> further?
>
> Agreed. I would avoid adding atleast_nd. We could discourage using
> atleast_3d (certainly the behavior is indeed surprising), but I'm not sure
> it's worth the trouble.
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list