Skip to content

API: provide examples of use of numpy random API via user stories #14778

@mattip

Description

@mattip

Gathered from gh-14604, gh-14517 and the discussions.

  • "To summarize I need to draw random ints of a given C type from continually changing ranges, either one-by-one or small batch-by-small batch."

  • Someone asked how to use random in a ufunc.

  • "An ideal API would allow projects like https://github.com/deepmind/torch-randomkit/tree/master/randomkit or numba to consume the code in NumPy without vendoring it."

  • "There are c++ applications which use boost::random, would be nice to be able to swap it for numpy.random."

  • "Using the existing distributions from Cython was a requested feature and an explicit goal, yes. There are users waiting for this." (mattip: but isn't this supported via Generator?)

  • "Numba would definitely appreciate C functions to access the random distribution implementations, and

  • have a side-project (numba-scipy) that is making the Cython wrapped functions in SciPy visible to Numba" (mattip: I think we do this after API: rearrange the cython files in numpy.random #14608 from _generator.so via these cdef extern declarations, but that requires the H file.

  • Someone who wants to write a new BitGenerator, i.e., the numpy/bitgenerator repo without needing to have the numpy code as a git submodule

Some of these are already be handled by gh-14604, but I am putting them here for completeness

Edit: turned into a checklist

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions