Skip to content

Commit

Permalink
Github Actions doc build after commit 548009b
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Sep 23, 2024
1 parent 74ce28c commit e31f680
Show file tree
Hide file tree
Showing 562 changed files with 4,614 additions and 4,484 deletions.
18 changes: 8 additions & 10 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@



<title>Overview: module code - RandomGen 1.26.1</title>
<title>Overview: module code - RandomGen 2.0.0</title>



Expand All @@ -36,7 +36,7 @@
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>


<link rel="stylesheet" type="text/css" href="../_static/sphinx_immaterial_theme.af531f03affe68837.min.css?v=2410bb73" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_immaterial_theme.3625f807144f53acf.min.css?v=fbfc4466" />
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>


Expand Down Expand Up @@ -75,7 +75,7 @@

<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../index.html" title="RandomGen 1.26.1" class="md-header__button md-logo" aria-label="RandomGen 1.26.1" data-md-component="logo">
<a href="../index.html" title="RandomGen 2.0.0" class="md-header__button md-logo" aria-label="RandomGen 2.0.0" data-md-component="logo">
<img src="../_static/casino.svg" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
Expand All @@ -85,7 +85,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
RandomGen 1.26.1
RandomGen 2.0.0
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
Expand Down Expand Up @@ -172,10 +172,10 @@

<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../index.html" title="RandomGen 1.26.1" class="md-nav__button md-logo" aria-label="RandomGen 1.26.1" data-md-component="logo">
<a href="../index.html" title="RandomGen 2.0.0" class="md-nav__button md-logo" aria-label="RandomGen 2.0.0" data-md-component="logo">
<img src="../_static/casino.svg" alt="logo">
</a>
RandomGen 1.26.1
RandomGen 2.0.0
</label>

<div class="md-nav__source">
Expand Down Expand Up @@ -496,8 +496,7 @@


<h1>All modules for which code is available</h1>
<ul><li><a href="randomgen/_seed_sequence.html">randomgen._seed_sequence</a></li>
<li><a href="randomgen/aes.html">randomgen.aes</a></li>
<ul><li><a href="randomgen/aes.html">randomgen.aes</a></li>
<li><a href="randomgen/chacha.html">randomgen.chacha</a></li>
<li><a href="randomgen/common.html">randomgen.common</a></li>
<li><a href="randomgen/dsfmt.html">randomgen.dsfmt</a></li>
Expand All @@ -509,7 +508,6 @@ <h1>All modules for which code is available</h1>
<li><a href="randomgen/lxm.html">randomgen.lxm</a></li>
<li><a href="randomgen/mt19937.html">randomgen.mt19937</a></li>
<li><a href="randomgen/mt64.html">randomgen.mt64</a></li>
<li><a href="randomgen/mtrand.html">randomgen.mtrand</a></li>
<li><a href="randomgen/pcg32.html">randomgen.pcg32</a></li>
<li><a href="randomgen/pcg64.html">randomgen.pcg64</a></li>
<li><a href="randomgen/philox.html">randomgen.philox</a></li>
Expand Down Expand Up @@ -555,7 +553,7 @@ <h1>All modules for which code is available</h1>

Created using
<a href="https://www.sphinx-doc.org/" target="_blank" rel="noopener">Sphinx</a>
7.2.6.
8.0.2.
and
<a href="https://github.com/jbms/sphinx-immaterial/" target="_blank" rel="noopener">Sphinx-Immaterial</a>

Expand Down
9 changes: 0 additions & 9 deletions _sources/bit_generators/chacha.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ Seeding and State
~ChaCha.seed
~ChaCha.state

Parallel generation
===================
.. autosummary::
:toctree: generated/

~ChaCha.advance
~ChaCha.jump
~ChaCha.jumped

Extending
=========
.. autosummary::
Expand Down
28 changes: 15 additions & 13 deletions _sources/change-log.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
Change Log
----------

.. container:: admonition danger

.. raw:: html

<p class="admonition-title"> Deprecated </p>

``Generator`` and ``RandomState`` were **REMOVED** in 1.23.
You should be using :class:`numpy.random.Generator` or
:class:`numpy.random.RandomState` which are maintained.
v2.0.0
======
- Final compatibility with NumPy 2
- Minimum NumPy is now 1.22.3.
- Removed ``"legacy"`` seeding in favor of using :class:`~numpy.random.SeedSequence`.
- Removed the vendored copy of ``SeedSequence``.
- Deprecated using the ``mode`` keyword argument to set the seed mode, since only ``SeedSequences`` are supported.
- Changed ``randomgen.common.BitGenerator`` to inherit from ``numpy.random.BitGenerator`` so that
numpy will recognize these as ``BitGenerators``.
- Removed C distribution functions that are available in NumPy (see libnpyrandom)`.
- General code cleanup and modernization.

v1.26.1
=======
Expand Down Expand Up @@ -54,7 +56,7 @@ v1.20.2
:class:`~randomgen.mt19937.MT19937`, :class:`~randomgen.philox.Philox`, and
:class:`~randomgen.sfc.SFC64`. When using this mode, the sequence generated is
guaranteed to match the sequence produced using the NumPy implementations as long as
a :class:`~randomgen.seed_sequence.SeedSequence` or :class:`numpy.random.SeedSequence`
a ``randomgen.seed_sequence.SeedSequence`` or :class:`numpy.random.SeedSequence`
is used with the same initial seed values.
- Added :func:`~randomgen.generator.ExtendedGenerator.random` with support for
``dtype="longdouble"`` to produce extended precision random floats.
Expand Down Expand Up @@ -139,13 +141,13 @@ 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`
- Added support for ``randomgen.seed_sequence.SeedSequence`` (and NumPy's :class:`~numpy.random.SeedSequence`).
- 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
2 changes: 1 addition & 1 deletion _sources/evolution.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ The main changes are
* Change ``jump`` which operated in-place to ``jumped`` which returns a new ``BitGenerator``.
* Rename Basic RNG to bit generator, which impacts the API in multiple places where names
like ``brng`` and ``basic_rng`` have been replaced by ``bitgen`` or ``bit_generator``.
* Support for :class:`~randomgen.seed_sequence.SeedSequence` (also support NumPy ``SeedSequence`` instances)
* Support for ``randomgen.seed_sequence.SeedSequence`` (also support NumPy :class:`~numpy.random.SeedSequence` instances)
* Removed support for Python 2.7
7 changes: 2 additions & 5 deletions _sources/generator.rst.txt
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 _sources/index.rst.txt
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 _sources/legacy.rst.txt
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`.
19 changes: 10 additions & 9 deletions _sources/multithreading.rst.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
Multithreaded Generation
========================

The four core distributions all allow existing arrays to be filled using the
``out`` keyword argument. Existing arrays need to be contiguous and
well-behaved (writable and aligned). Under normal circumstances, arrays
created using the common constructors such as :meth:`numpy.empty` will satisfy
these requirements.
The four core distributions in :class:`~numpy.random.Generator` all allow
existing arrays to be filled using the ``out`` keyword argument.
Existing arrays need to be contiguous and well-behaved (writable and aligned).
Under normal circumstances, arrays created using the common constructors such
as :func:`numpy.empty` will satisfy these requirements.

This example makes use of Python 3 :mod:`concurrent.futures` to fill an array
using multiple threads. Threads are long-lived so that repeated calls do not
require any additional overheads from thread creation. The underlying PRNG is
xorshift2014 which is fast, has a long period and supports using ``jumped`` to
xorshift256 which is fast, has a long period and supports using ``jumped`` to
advance the state. The random numbers generated are reproducible in the sense
that the same seed will produce the same outputs.

.. code-block:: ipython
from randomgen import Xoshiro256
import multiprocessing
import concurrent.futures
import numpy as np
import warnings
warnings.filterwarnings("ignore", "Generator", FutureWarning)
from numpy.random import Generator
from randomgen import Xoshiro256
class MultithreadedRNG(object):
def __init__(self, n, seed=None, threads=None):
last_bg = Xoshiro256(seed, mode="sequence")
last_bg = Xoshiro256(seed)
if threads is None:
threads = multiprocessing.cpu_count()
self.threads = threads
Expand Down
90 changes: 0 additions & 90 deletions _sources/new-or-different.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,96 +63,6 @@ Differences from NumPy (1.17+)
* :class:`~randomgen.xoshiro256.Xoshiro256`
* :class:`~randomgen.xoshiro512.Xoshiro512`

.. container:: admonition danger

.. raw:: html

<p class="admonition-title"> Deprecated </p>

``Generator`` is **deprecated**. You should be using
:class:`numpy.random.Generator`.

* randomgen's ``Generator`` continues to expose legacy
methods ``random_sample``, ``randint``, ``random_integers``, ``rand``, ``randn``,
and ``tomaxint``. **Note**: These should not be used, and their modern replacements are preferred:

* ``random_sample``, ``rand` → ``random``
* ``random_integers``, ``randint`` → ``integers``
* ``randn`` → ``standard_normal``
* ``tomaxint`` → ``integers`` with ``dtype`` set to ``int``

* randomgen's bit generators remain seedable and the convenience function
``seed` is exposed as part of``Generator``. Additionally, the convenience
property ``state`` is available to get or set the state of the underlying bit generator.

* :func:`numpy.random.Generator.multivariate_hypergeometric` was added after
``Generator`` was merged into NumPy and will not be ported over.

* :func:`numpy.random.Generator.shuffle` and :func:`numpy.random.Generator.permutation`
support ``axis`` keyword to operator along an axis other than 0.

* ``integers`` supports the keyword argument ``use_masked`` to switch between masked
generation of bounded integers and Lemire's superior method.

Differences from NumPy before 1.17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* The normal, exponential and gamma generators use 256-step Ziggurat
methods which are 2-10 times faster than NumPy's default implementation in
``standard_normal``, ``standard_exponential`` or ``standard_gamma``.

* The Box-Muller used to produce NumPy's normals is no longer available.
* All bit generators functions to produce doubles, uint64s and
uint32s via CTypes (:meth:`~randomgen.xoroshiro128.Xoroshiro128.ctypes`)
and CFFI (:meth:`~randomgen.xoroshiro128.Xoroshiro128.cffi`). This allows
the bit generators to be used in numba or in other low-level applications
* The bit generators can be used in downstream projects via Cython.
* Optional ``dtype`` argument that accepts ``np.float32`` or ``np.float64``
to produce either single or double prevision uniform random variables for
select core distributions

* Uniforms (``random`` and ``rand``)
* Normals (``standard_normal`` and ``randn``)
* Standard Gammas (``standard_gamma``)
* Standard Exponentials (``standard_exponential``)

* Optional ``out`` argument that allows existing arrays to be filled for
select core distributions

* Uniforms (``random``)
* Normals (``standard_normal``)
* Standard Gammas (``standard_gamma``)
* Standard Exponentials (``standard_exponential``)

This allows multithreading to fill large arrays in chunks using suitable
PRNGs in parallel.


* ``integers`` supports broadcasting inputs.

* ``integers`` supports drawing from open (default, ``[low, high)``) or closed
(``[low, high]``) intervals using the keyword argument
``endpoint``. Closed intervals are simpler to use when the
distribution may include the maximum value of a given integer type.


* The closed interval is particularly helpful when using arrays since
it avoids object-dtype arrays when sampling from the full range.


* Support for Lemire’s method of generating uniform integers on an
arbitrary interval by setting ``use_masked=True`` in
(``integers``).


* ``multinomial`` supports multidimensional values of ``n``


* ``choice`` is much faster when sampling small amounts from large arrays


* ``choice`` supports the ``axis`` keyword to work with multidimensional arrays.


* For changes since the previous release, see the :ref:`change-log`

.. _the demonstration notebook: custom-bit-generators.ipynb
29 changes: 5 additions & 24 deletions _sources/seed_sequence.rst.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
Seed Sequences
--------------

.. module:: randomgen._seed_sequence

.. currentmodule:: randomgen._seed_sequence

.. note::

randomgen imports ``SeedSequece`` from NumPy if available, and only falls back to a vendored
copy if not. The correct import location is ``randomgen.seed_sequence`` which handles to
selection of the correct ``SeedSequence``.

.. autoclass:: SeedSequence

Using a SeedSequence
====================

.. autosummary::
:toctree: generated/

~SeedSequence.generate_state
~SeedSequence.spawn

State
=====
randomgen imports :class:`~numpy.random.SeedSequence` from NumPy. As of version 2.0.0, randomgen does not provide
a vendored copy of ``SeedSequence``.

.. autosummary::
:toctree: generated/
.. deprecated:: 2.0.0

~SeedSequence.state
``SeedSequence`` is now available in NumPy. Use :class:`~numpy.random.SeedSequence`
instead. Importing ``SeedSequence`` from randomgen will be removed in a future version.
Loading

0 comments on commit e31f680

Please sign in to comment.