[Numpy-discussion] ENH: Proposal to add atleast_nd function

Ralf Gommers ralf.gommers at gmail.com
Wed Feb 17 05:35:52 EST 2021


On Wed, Feb 17, 2021 at 12:26 AM Stefan van der Walt <stefanv at berkeley.edu>
wrote:

> On Tue, Feb 16, 2021, at 07:49, Joseph Fox-Rabinovitz wrote:
>
> I'm getting a generally lukewarm not negative response. Should we put it
> to a vote?
>
>
> Things here don't typically get decided by vote—I think you'll have to
> build towards consensus.  It may be overkill to write a NEP, but outlining
> a proposed solution along with pros and cons and getting everyone on board
> is necessary.
>
> The API surface is a touchy issue, and so it is difficult to get new
> features like these added.
>

This function is less bad than most similar utility functions, because it
starts with atleast_ so from a "function browsing" end user perspective
it's not much additional clutter. But it does still force other libraries
to do work because they aim to be compatible to numpy's main namespace
(e.g. see jax.numpy).

And there's 6-7 maintainers all not strongly opposed but also not
enthusiastic.


> Ralf has been working towards this idea, but having a well-organised
> namespace of utility functions outside of the core NumPy API would be
> helpful in allowing expansion and experimentation, without making the
> current situation worse (where we effectively have to support things
> forever).  As an example, take Cartesian product [0] and array combinations
> [1], which have been requested several times on StackOverflow, but there's
> nowhere to put them.
>

This is a good point. If we could put it in `numpy.lib` without it bleeding
into the main namespace, saying yes here would be easier. Maybe we can give
it a conditional yes based on that namespace reorganization?

Cheers,
Ralf


> Stéfan
>
> [0]
> https://stackoverflow.com/questions/1208118/using-numpy-to-build-an-array-of-all-combinations-of-two-arrays#comment22769580_1235363
>
> [1]
> https://stackoverflow.com/questions/16003217/n-d-version-of-itertools-combinations-in-numpy/16008578#16008578
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210217/f7a616e8/attachment-0001.html>


More information about the NumPy-Discussion mailing list