[Numpy-discussion] Low-level API for Random

Stefan van der Walt stefanv at berkeley.edu
Wed Sep 25 13:53:38 EDT 2019

On Fri, Sep 20, 2019, at 21:30, Robert Kern wrote:
> Given the prevalence of Cython, it's actually really easy to use the Python API pretty easily in "C", so it's actually a huge waste if the C API matches the Python API too closely. The power and utility of the C API will be in how it *differs* from the Python API. For the distribution methods, this is largely in how it lets you sample one number at a time without bothering with the numpy and broadcasting overhead. That's the driving motivation for having a C API for the distributions, and the algorithms that we choose have consequences for the C API that will best satisfy that motivation.

I'd like to clarify what exactly we mean by exposing a C API. Do we have in mind that our random number generators can be used from standalone C code, or via Cython `cimport` like with the current numpy.pxd?

It sounds like we want to expose the highest level generators; do we also want to provide access to the bit streams?

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190925/d3296b45/attachment.html>

More information about the NumPy-Discussion mailing list