summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorKevin Sheppard <kevin.k.sheppard@gmail.com>2022-07-17 14:16:24 +0100
committerKevin Sheppard <kevin.k.sheppard@gmail.com>2022-08-11 15:28:25 +0100
commit962535f7cbf3265e4f11a339b682dd3c7d312424 (patch)
tree3c9967af28e13a5db59a9c098eee108a5e8b05a5 /doc
parentcf3ca1587bcadfb0747b7ec31c3e0fdc988ef1e8 (diff)
downloadnumpy-962535f7cbf3265e4f11a339b682dd3c7d312424.tar.gz
DOC: Correct doc errors
Fix typos and wrap length
Diffstat (limited to 'doc')
-rw-r--r--doc/release/upcoming_changes/21976.new_feature.rst33
1 files changed, 17 insertions, 16 deletions
diff --git a/doc/release/upcoming_changes/21976.new_feature.rst b/doc/release/upcoming_changes/21976.new_feature.rst
index 7d1cb0405..d0960fd94 100644
--- a/doc/release/upcoming_changes/21976.new_feature.rst
+++ b/doc/release/upcoming_changes/21976.new_feature.rst
@@ -1,31 +1,32 @@
The bit generator underlying the singleton RandomState can be changed
---------------------------------------------------------------------
The singleton ``RandomState`` instance exposed in the ``numpy.random`` module
-id initialized using system-provided entropy with the ``MT19937` bit generator.
-The function ``set_bit_generator`` allows the default bit generator to be
-replaced with a user-provided bit generator. This function has been introduced to
-provide a method allowing seemless integration of a high-quality, modern bit generator
-in new code with existing code that makes use of the singleton-provided random
-variate generating functions. The companion function ``get_bit_generator`` returns the current bit generator
-being used by the singleton ``RandomState``. This is provided to simplify restoring
+is initialized at startup with the ``MT19937` bit generator. The function new ``set_bit_generator`` allows the default bit generator to be
+replaced with a user-provided bit generator. This function has been introduced
+to provide a method allowing seamless integration of a high-quality, modern bit
+generator in new code with existing code that makes use of the
+singleton-provided random variate generating functions. The companion function
+``get_bit_generator`` returns the current bit generator being used by the
+singleton ``RandomState``. This is provided to simplify restoring
the original source of randomness if required.
The preferred method to generate reproducible random numbers is to use a modern
bit generator in an instance of ``Generator``. The function ``default_rng``
simplifies instantization.
- >>> rg = np.random.default_rng(3728973198)
- >>> rg.random()
+ >>> rg = np.random.default_rng(3728973198)
+ >>> rg.random()
-The same bit generator can then shared with the singleton instance so that
-calling functions in the ``random`` module will use the same bit generator.
+The same bit generator can then be shared with the singleton instance so that
+calling functions in the ``random`` module will use the same bit
+generator.
- >>> orig_bit_gen = np.random.get_bit_generator()
- >>> np.random.set_bit_generator(rg.bit_generator)
- >>> np.random.normal()
+ >>> orig_bit_gen = np.random.get_bit_generator()
+ >>> np.random.set_bit_generator(rg.bit_generator)
+ >>> np.random.normal()
The swap is permanent (until reversed) and so any call to functions
-in the ``random`` module will use the new bit generator. The orginal
+in the ``random`` module will use the new bit generator. The original
can be restored if required for code to run correctly.
- >>> np.random.set_bit_generator(orig_bit_gen)
+ >>> np.random.set_bit_generator(orig_bit_gen)