Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide all random number generators provided by numpy #137

Closed
1 of 3 tasks
gdementen opened this issue Sep 1, 2014 · 1 comment
Closed
1 of 3 tasks

provide all random number generators provided by numpy #137

gdementen opened this issue Sep 1, 2014 · 1 comment
Assignees
Milestone

Comments

@gdementen
Copy link
Member

@gdementen gdementen commented Sep 1, 2014

We cannot do this in a "future-proof" way (without somehow listing the functions) because we need the
type information.

  • create a special "random" symbol/pseudo-module and add attributes
  • use the following code to get/update the list:
import numpy as np

names = [n for n in dir(np.random)
         if (not n.startswith('__') and
             n not in {'RandomState', 'Tester', 'absolute_import', 'bench',
                       'division', 'get_state', 'info', 'mtrand', 'np',
                       'operator', 'print_function', 'seed', 'set_state',
                       'test', 'warnings'})]
argspecs = [getattr(np.random, n).__doc__.splitlines()[1].strip()
            for n in names]
print('\n'.join(argspecs))
  • make utils.argspec accept a (single) string to make it easier to update. Not sure if it should take a string including the function name eg "random_integers(low, high=None, size=None)" or only the string for arguments, eg "low, high=None, size=None"
@gdementen gdementen self-assigned this Sep 1, 2014
@gdementen gdementen added this to the 0.9 milestone Sep 1, 2014
@gdementen
Copy link
Member Author

@gdementen gdementen commented Oct 17, 2014

done in feed581 (except for the "random" symbol/pseudo-module)

Loading

@gdementen gdementen closed this Oct 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant