summaryrefslogtreecommitdiff
path: root/numpy/random/threefry.pyx
diff options
context:
space:
mode:
authorKevin Sheppard <kevin.k.sheppard@gmail.com>2019-05-23 11:11:59 +0100
committermattip <matti.picus@gmail.com>2019-05-27 22:58:35 +0300
commit7c52c2810e20a9e483e564751b8e2342c97f56c2 (patch)
treea6de2e359d75a4a61e27ed1a5f3e3672386c3834 /numpy/random/threefry.pyx
parent9e5ae6156855e5a2e2edccaf0112362ecb6d31fc (diff)
downloadnumpy-7c52c2810e20a9e483e564751b8e2342c97f56c2.tar.gz
DOC: Add __all__ and document lock
Add docstring for lock Use __all__ to discuorage unless attributes from appearing
Diffstat (limited to 'numpy/random/threefry.pyx')
-rw-r--r--numpy/random/threefry.pyx10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/random/threefry.pyx b/numpy/random/threefry.pyx
index d008cd828..02911528b 100644
--- a/numpy/random/threefry.pyx
+++ b/numpy/random/threefry.pyx
@@ -11,6 +11,8 @@ from .common cimport *
from .distributions cimport bitgen_t
from .entropy import random_entropy, seed_by_array
+__all__ = ['ThreeFry']
+
np.import_array()
DEF THREEFRY_BUFFER_SIZE=4
@@ -74,6 +76,14 @@ cdef class ThreeFry:
a Python int in [0, 2**256) or a 4-element uint64 array.
key and seed cannot both be used.
+ Attributes
+ ----------
+ lock: threading.Lock
+ Lock instance that is shared so that the same bit git generator can
+ be used in multiple Generators without corrupting the state. Code that
+ generates values from a bit generator should hold the bit generator's
+ lock.
+
Notes
-----
ThreeFry is a 64-bit PRNG that uses a counter-based design based on