PR with changes to triangular array functions
I submitted a PR that makes some improvements to the numpy functions dealing with triangular arrays. Aside from a general speedup of about 2x for most functions, there are some minor changes to the public API. In case anyone is concerned about them, here's a list: * 'np.tri' now accepts a boolean 'invert' kwarg that is equivalent to '1  np.tri' only faster. * 'np.mask_indices' is no longer used by any of the triangular array functions. While it is part of the public API, it is not even mentioned in the documentation AFAICT. It may be a candidate for deprecation IMO. * 'np.tril_indices' and 'np.triu_indices' now accept an 'm' kwarg to indicate the number of columns of the array, so they are no longer restricted to square arrays. The weird thing is that, to preserve the order of the existing arguments, the signature is '(n, k=0, m=None)', while other similar functions, such as 'np.tri', have signature '(n, m=None, k=0)'. * 'np.triu_indices_from' and 'np.tril_indices_from' now also accept rectangular arrays. The PR can be found here: https://github.com/numpy/numpy/pull/4509 Jaime  (\__/) ( O.o) ( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes de dominación mundial.
On Tue, Mar 18, 2014 at 11:21 PM, Jaime Fernández del Río < jaime.frio@gmail.com> wrote:
I submitted a PR that makes some improvements to the numpy functions dealing with triangular arrays. Aside from a general speedup of about 2x for most functions, there are some minor changes to the public API. In case anyone is concerned about them, here's a list:
Hi Jaime, I have no concerns but do want to say thank you for the excellent summaries of your PRs that you send to the lists. Great to keep everyone who doesn't follow Github activity informed, we should all be doing this more often! Cheers, Ralf
* 'np.tri' now accepts a boolean 'invert' kwarg that is equivalent to '1  np.tri' only faster. * 'np.mask_indices' is no longer used by any of the triangular array functions. While it is part of the public API, it is not even mentioned in the documentation AFAICT. It may be a candidate for deprecation IMO. * 'np.tril_indices' and 'np.triu_indices' now accept an 'm' kwarg to indicate the number of columns of the array, so they are no longer restricted to square arrays. The weird thing is that, to preserve the order of the existing arguments, the signature is '(n, k=0, m=None)', while other similar functions, such as 'np.tri', have signature '(n, m=None, k=0)'. * 'np.triu_indices_from' and 'np.tril_indices_from' now also accept rectangular arrays.
The PR can be found here: https://github.com/numpy/numpy/pull/4509
Jaime  (\__/) ( O.o) ( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes de dominación mundial.
_______________________________________________ NumPyDiscussion mailing list NumPyDiscussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpydiscussion
participants (2)

Jaime Fernández del Río

Ralf Gommers