diff --git a/doc/source/bit_generators/efiix64.rst b/doc/source/bit_generators/efiix64.rst index 6eecba9d8..d8193a292 100644 --- a/doc/source/bit_generators/efiix64.rst +++ b/doc/source/bit_generators/efiix64.rst @@ -1,5 +1,5 @@ -HC-128 Cipher Generator ------------------------ +Entropy From Iteration, Indirection, Xor (EFIIX) Generator +----------------------------------------------------------- .. module:: randomgen.efiix64 diff --git a/doc/source/conf.py b/doc/source/conf.py index 76301d332..058552ec5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -268,5 +268,13 @@ def show(*args, **kwargs): napoleon_preprocess_types = True napoleon_use_param = True +napoleon_type_aliases = { + "array-like": ":term:`array-like `", + "array_like": ":term:`array_like`", + "ndarray": "numpy.ndarray", + "np.ndarray": "numpy.array", +} + + autosummary_generate = True autoclass_content = "class" diff --git a/doc/source/performance.rst b/doc/source/performance.rst index 543c45980..46c80a36e 100644 --- a/doc/source/performance.rst +++ b/doc/source/performance.rst @@ -6,16 +6,16 @@ Performance Recommendation ************** The recommended generator for single use is :class:`~randomgen.pcg64.PCG64DXSM` -although :class:`~randomgen.sfc64.SFC64` and :class:`~randomgen.xoshiro256.Xoshiro256` +although :class:`~randomgen.sfc.SFC64` and :class:`~randomgen.xoshiro256.Xoshiro256` are both excellent alternatives. :class:`~randomgen.romu.Romu` is a newer generator that is also very fast. For very large scale applications -- requiring 1,000+ streams -- :class:`~randomgen.pcg64.PCG64DXSM` combined with a :class:`~numpy.random.SeedSequence` and ``spawn``, -:class:`~randomgen.sfc64.SFC64` initialized using distinct Weyl increments (``k``), or one of +:class:`~randomgen.sfc.SFC64` initialized using distinct Weyl increments (``k``), or one of the cryptography-based generators :class:`~randomgen.aes.AESCounter` (if you have hardware acceleration), -:class:`~randomgen.effix64.EFFIC64`, :class:`~randomgen.speck128.SPECK128`, +:class:`~randomgen.efiix64.EFIIX64`, :class:`~randomgen.speck128.SPECK128`, :class:`~randomgen.philox.Philox`, or :class:`~randomgen.hc128.HC128` if you do not) initialized with distinct keys are all excellent choices. @@ -27,10 +27,10 @@ Timings ******* The timings below are the time in ns to produce 1 random value from a -specific distribution. :class:`~randomgen.sfc64.SFC64` is the fastest, +specific distribution. :class:`~randomgen.sfc.SFC64` is the fastest, followed closely by :class:`~randomgen.xoshiro256.Xoshiro256`, :class:`~randomgen.pcg64.PCG64DXSM`, :class:`~randomgen.jsf.JSF`, -and :class:`~randomgen.effix64.EFFIX64`. The original +and :class:`~randomgen.efiix64.EFIIX64`. The original NumPy :class:`~randomgen.mt19937.MT19937` generator is slower since it requires 2 32-bit values to equal the output of the faster generators. diff --git a/randomgen/_seed_sequence.pyx b/randomgen/_seed_sequence.pyx index 869485ad4..fa2f48a19 100644 --- a/randomgen/_seed_sequence.pyx +++ b/randomgen/_seed_sequence.pyx @@ -191,6 +191,7 @@ class ISeedSequence(metaclass=abc.ABCMeta): Parameters ---------- n_words : int + Number of 32- or 64-bit words to generate. dtype : np.uint32 or np.uint64, optional The size of each word. This should only be either `uint32` or `uint64`. Strings (`"uint32"`, `"uint64"`) are fine. Note that @@ -200,12 +201,13 @@ class ISeedSequence(metaclass=abc.ABCMeta): Returns ------- - state : uint32 or uint64 array, shape=(n_words,) + state : uint32 or uint64 array + Array with shape (n_words,) """ class ISpawnableSeedSequence(ISeedSequence): - """ + """w Abstract base class for seed sequences that can spawn. """ diff --git a/randomgen/common.pyx b/randomgen/common.pyx index 89c0758a6..1c5ad5dbe 100644 --- a/randomgen/common.pyx +++ b/randomgen/common.pyx @@ -163,7 +163,7 @@ cdef class BitGenerator: Returns ------- - interface : namedtuple + interface : NamedTuple Named tuple containing ctypes wrapper * state_address - Memory address of the state struct @@ -185,7 +185,7 @@ cdef class BitGenerator: Returns ------- - interface : namedtuple + interface : NamedTuple Named tuple containing CFFI wrapper * state_address - Memory address of the state struct @@ -292,7 +292,7 @@ cdef object prepare_cffi(bitgen_t *bitgen): Returns ------- - interface : namedtuple + interface : NamedTuple The functions required to interface with the bit generator using cffi * state_address - Memory address of the state struct diff --git a/randomgen/entropy.pyx b/randomgen/entropy.pyx index ef4f174ba..10f96a5d5 100644 --- a/randomgen/entropy.pyx +++ b/randomgen/entropy.pyx @@ -117,7 +117,7 @@ def random_entropy(size=None, source="system"): Returns ------- - entropy : scalar or array + entropy : scalar or ndarray Entropy bits in 32-bit unsigned integers. A scalar is returned if size is `None`. diff --git a/setup.py b/setup.py index cd4d5df0d..2ba9222f3 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import Distribution, find_namespace_packages, find_packages, setup +from setuptools import Distribution, find_namespace_packages, setup from setuptools.extension import Extension import glob @@ -346,9 +346,7 @@ def is_pure(self): force=CYTHON_COVERAGE or DEBUG, gdb_debug=DEBUG, ), - packages=sorted( - set(find_packages() + find_namespace_packages(include=["randomgen.*"])) - ), + packages=["randomgen"] + find_namespace_packages(include=["randomgen.*"]), package_dir={"randomgen": "./randomgen"}, package_data={ "": ["*.h", "*.pxi", "*.pyx", "*.pxd", "*.in", "py.typed"],