On Wed, May 22, 2019 at 7:34 PM Nathan Goldbaum <nathan12...@gmail.com>
wrote:

> It might be worth using BigQuery to search the github repository public
> dataset for usages of np.sinc with keyword arguments.
>

We spent some effort at Quansight to try different approaches to this.
BigQuery turns out to be suboptimal, parsing code with ast.parse is more
robust. Chris Ostrouchov just released some code for this (blog post with
details to follow) and the results of running that code:
https://github.com/Quansight-Labs/python-api-inspect/blob/master/data/numpy-summary.csv

np.sinc has 35 usages. to put that in perspective, np.array has ~31,000,
np.dot ~2200, np.floor ~220, trace/inner/spacing/copyto are all similar to
sinc.





> On Wed, May 22, 2019 at 1:05 PM Sebastian Berg <sebast...@sipsolutions.net>
> wrote:
>
>> Hi all,
>>
>> there is an open PR (https://github.com/numpy/numpy/pull/12924) to
>> convert `np.sinc` into a ufunc. Since it should improve general
>> precision in `np.sinc`, I thought we could try to move that forward a
>> bit. We check whether this is worth it or not in the end.
>>
>
Can you quantify the precision improvement (approximately)?


>> However, it would also change behaviour slightly since `np.sinc(x=arr)`
>> will not work, as ufuncs are positional arguments only (we could wrap
>> `sinc`, but that hides all the nice features).
>
>
This would give an exception, so at least it's easy to fix. As backwards
compat breaks go, this is a pretty minor one I think.

Otherwise, there should
>> be no change except additional features of ufuncs and the move to a C
>> implementation.
>>
>
I see this is one of the functions that uses asanyarray, so what about
impact on subclass behavior?

Cheers,
Ralf


>> This is mostly to see if anyone is worried about possible slight API
>> change here.
>>
>> All the Best,
>>
>> Sebastian
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion@python.org
>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to