[Numpy-discussion] Re: [Feature Request] Add alias of np.concatenate as np.concat

2022-05-10 Thread David Menéndez Hurtado
I don't have any opinion on whether this is a good idea or not, but in the
meantime, you can monkey-patch numpy:

np.concat = np.concatenate

And you get your compatibility. And, since modules are singletons, I
believe you only have to do it once and it will propagate across your
modules.

/David

On Mon, 1 Jun 2020, 8:24 pm Iordanis Fostiropoulos, <
danny.fostiropou...@gmail.com> wrote:

> In regard to Feature Request: https://github.com/numpy/numpy/issues/16469
>
> It was suggested to sent to the mailing list. I think I can make a strong
> point as to why the support for this naming convention would make sense.
> Such as it would follow other frameworks that often work alongside numpy
> such as tensorflow. For backward compatibility, it can simply be an alias
> to np.concatenate
>
> I often convert portions of code from tf to np, it is as simple as
> changing the base module from tf to np. e.g. np.expand_dims ->
> tf.expand_dims. This is done either in debugging (e.g. converting tf to np
> without eager execution to debug portion of the code), or during
> prototyping, e.g. develop in numpy and convert in tf.
>
> I find myself more than at one occasion to getting syntax errors because
> of this particular function np.concatenate. It is unnecessarily long. I
> imagine there are more people that also run into the same problems. Pandas
> uses concat (torch on the other extreme uses simply cat, which I don't
> think is as descriptive).
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: [Feature Request] Add alias of np.concatenate as np.concat

2022-05-10 Thread Aaron Meurer
This table lists all the array API spec names that are different in
NumPy. Most should be addable with a simple alias.
https://numpy.org/devdocs/reference/array_api.html#function-name-changes

Aaron Meurer

On Tue, May 10, 2022 at 12:47 AM Matti Picus  wrote:
>
> The array API defines concat [0] so that is a powerful reason to implement an 
> alias as part of bringing NumPy into compliance.
>
>
> Matti
>
>
> [0] 
> https://data-apis.org/array-api/latest/API_specification/manipulation_functions.html
>
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: asmeu...@gmail.com
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com