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

gdementen opened this Issue Sep 1, 2014 · 1 comment


None yet
1 participant

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]
  • 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


This comment has been minimized.

Show comment
Hide comment

gdementen Oct 17, 2014


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


gdementen commented Oct 17, 2014

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

@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