Skip to content

Commit

Permalink
Merge pull request #372 from bashtage/doc-fixes
Browse files Browse the repository at this point in the history
DOC: Fix docs
  • Loading branch information
bashtage authored Sep 20, 2024
2 parents 983fd88 + 122a473 commit eabbc99
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 38 deletions.
7 changes: 4 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
numba>=0.49
nbsphinx
sphinx-immaterial
sphinx>=5
ipython>=6
pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability
sphinx>=8
ipython>=8
pickleshare
pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability
4 changes: 2 additions & 2 deletions doc/source/change-log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ v1.18.0
- ``choice`` pulled in upstream performance improvement that
use a hash set when choosing without replacement and without user-provided probabilities.
- Added support for :class:`~randomgen.seed_sequence.SeedSequence` (and NumPy's ``SeedSequence``).
- Fixed a bug that affected both :class:`~randomgen.generator.Generator.randint`
- Fixed a bug that affected both ``randomgen.generator.Generator.randint``
in ``Generator`` and ``randint``
in ``RandomState`` when ``high=2**32``. This value is inbounds for
a 32-bit unsigned closed interval generator, and so should have been redirected to
a 32-bit generator. It was erroneously sent to the 64-bit path. The random values produced
are fully random but inefficient. This fix breaks the stream in :class:`~randomgen.generator.Generator
are fully random but inefficient. This fix breaks the stream in ``randomgen.generator.Generator``
is the value for ``high`` is used. The fix restores ``RandomState`` to
NumPy 1.16 compatibility.
only affects the output if ``dtype`` is ``'int64'``
Expand Down
14 changes: 6 additions & 8 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,12 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"statsmodels": ("https://www.statsmodels.org/dev/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"np": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"pd": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"statsmodels": ("https://www.statsmodels.org/dev", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
}


Expand Down
7 changes: 2 additions & 5 deletions doc/source/generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ Random Generator

.. danger::

``Generator`` has been **removed**. You should be using :class:`numpy.random.Generator`.
``Generator`` has been completely **removed** in randomgen 2.0.0.
You should be using :class:`numpy.random.Generator`.

.. currentmodule:: randomgen.generator

.. autoclass::
Generator
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Seed information is directly passed to the bit generator.

.. code-block:: python
rg = Generator(AESCounter(12345, mode="sequence"))
rg = Generator(AESCounter(12345))
rg.random()
History
Expand Down
11 changes: 4 additions & 7 deletions doc/source/legacy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ Legacy Random Generation

.. danger::

``RandomState`` has been **removed**. You should be using :class:`numpy.random.Generator`,
or if you must have backward compatibility with NumPy before 1.17, :class:`numpy.random.RandomState`.

.. currentmodule:: randomgen.mtrand

.. autoclass::
RandomState
``RandomState`` has been completely **removed** in randomgen 2.0.0.
You should be using :class:`numpy.random.Generator`, or if you must
have full stability (e.g., for writing tests) or backward compatibility
with NumPy before 1.17, :class:`numpy.random.RandomState`.
2 changes: 1 addition & 1 deletion randomgen/bounded_integers.pyx.in
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ cdef object _rand_{{nptype}}(object low, object high, object size,
Returns
-------
out : python scalar or ndarray of np.{{nptype}}
out : int or ndarray of np.{{nptype}}
`size`-shaped array of random integers from the appropriate
distribution, or a single such random int if `size` not provided.
Expand Down
3 changes: 0 additions & 3 deletions randomgen/dsfmt.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ cdef class DSFMT(BitGenerator):
``None`` (the default). If `seed` is ``None``, then 764 32-bit unsigned
integers are read from ``/dev/urandom`` (or the Windows analog) if
available. If unavailable, a hash of the time and process ID is used.
mode : {None, "sequence"}, optional
The seeding mode to use. "sequence" uses a SeedSequence
to transforms the seed into an initial state.
Attributes
----------
Expand Down
2 changes: 1 addition & 1 deletion randomgen/entropy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def random_entropy(size=None, source="system"):
Returns
-------
entropy : scalar or ndarray
entropy : int or ndarray
Entropy bits in 32-bit unsigned integers. A scalar is returned if size
is `None`.
Expand Down
6 changes: 3 additions & 3 deletions randomgen/generator.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ cdef class ExtendedGenerator:
Returns
-------
bit_generator : BitGenerator
bit_generator : numpy.random.BitGenerator
The bit generator instance used by the generator
"""
return self._bit_generator
Expand Down Expand Up @@ -239,7 +239,7 @@ cdef class ExtendedGenerator:
Returns
-------
out : uint or ndarray
out : integer or ndarray
Drawn samples.
Notes
Expand Down Expand Up @@ -561,7 +561,7 @@ cdef class ExtendedGenerator:
Returns
-------
out : ndarray or scalar
out : complex or ndarray
Drawn samples from the parameterized complex normal distribution.
See Also
Expand Down
2 changes: 1 addition & 1 deletion randomgen/legacy/bounded_integers.pyx.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ cdef object _legacy_rand_{{nptype}}(object low, object high, object size,
Returns
-------
out : python scalar or ndarray of np.{{nptype}}
out : int or ndarray of np.{{nptype}}
`size`-shaped array of random integers from the appropriate
distribution, or a single such random int if `size` not provided.
Expand Down
4 changes: 1 addition & 3 deletions randomgen/wrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ cdef object raw_32_to_double(object func):

cdef class UserBitGenerator(BitGenerator):
"""
UserBitGenerator(next_raw, bits=64, next_64=None, next_32=None,
next_double=None, state=None, state_getter=None,
state_setter=None)
UserBitGenerator(next_raw, bits=64, next_64=None, next_32=None, next_double=None, state=None, state_getter=None, state_setter=None)
Construct a bit generator from Python functions
Expand Down

0 comments on commit eabbc99

Please sign in to comment.