Skip to content

DOC: Clean up examples of low-level random access - #14951

Merged
mattip merged 1 commit into
numpy:masterfrom
bashtage:random-examples
Nov 21, 2019
Merged

mattip merged 1 commit into
numpy:masterfrom
bashtage:random-examples

Conversation

@bashtage

Copy link
Copy Markdown
Contributor

Test examples on Linux and Windows
Correct bug in Cython example
Improve building instructions for numba examples

Test examples on Linux and Windows
Correct bug in Cython example
Improve building instructions for numba examples
@bashtage

Copy link
Copy Markdown
Contributor Author

@mattip I don't quite see how the function in distributions.c can be used in Cython code. Am I missing something?

@mattip

mattip commented Nov 21, 2019

Copy link
Copy Markdown
Member

You are correct. We started that discussion in gh-14778, but did not resolve how to do this cleanly. I am also concerned that exposing all of the functions in lines 54-138 increases the C-API we then commit to maintain.

Comment thread numpy/random/_examples/cython/setup.py Resolved
out[i] = random_standard_normal(bit_generator)
return out


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could run this as part of the tests, like we run the extending.py example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on numba or at least CFFI, so probably not worth it. But definitely a risk that examples get stale, so ideally these things get run somewhere.

@bashtage

Copy link
Copy Markdown
Contributor Author

You are correct. We started that discussion in gh-14778, but did not resolve how to do this cleanly. I am also concerned that exposing all of the functions in lines 54-138 increases the C-API we then commit to maintain.

I'll move it over there then.

@mattip
mattip merged commit 48e0ded into numpy:master Nov 21, 2019
@bashtage
bashtage deleted the random-examples branch May 12, 2020 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants