Skip to content

Commit 5aab74b

Browse files
committed
add release date - update docs
1 parent 9ddf92c commit 5aab74b

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

CHANGE_LOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2025-XX-XX 3.5.1:
1+
2025-07-14 3.5.1:
22
-------------------
33
* optimize `util.random_p()` for `n < 100`
44
* add [Random Bitarrays](random_p.rst) documentation

doc/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Change log
22
==========
33

4+
**3.5.1** (2025-07-14):
5+
6+
* optimize ``util.random_p()`` for ``n < 100``
7+
* add `Random Bitarrays <random_p.rst>`__ documentation
8+
* add `statistical tests for random functions <../examples/test_random.py>`__
9+
10+
411
**3.5.0** (2025-07-06):
512

613
* add ``util.random_p()``

doc/reference.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Reference
22
=========
33

4-
bitarray version: 3.5.0 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
4+
bitarray version: 3.5.1 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
55

66
In the following, ``item`` and ``value`` are usually a single bit -
77
an integer 0 or 1.
@@ -503,15 +503,18 @@ This sub-module was added in version 1.2.
503503

504504

505505
``random_p(n, /, p=0.5, endian=None)`` -> bitarray
506-
Return pseudo-random bitarray of length ``n``. Each bit has probability ``p`` of
507-
being 1. Equivalent to ``bitarray((random() < p for _ in range(n)), endian)``.
508-
The bitarrays are reproducible when calling Python's ``random.seed()`` with a
509-
specific seed value.
506+
Return (pseudo-) random bitarray of length ``n``. Each bit has probability ``p``
507+
of being one (independent of any other bits). Mathematically equivalent
508+
to ``bitarray((random() < p for _ in range(n)), endian)``, but much faster
509+
for large ``n``. The random bitarrays are reproducible when giving
510+
Python's ``random.seed()`` with a specific seed value.
510511

511512
This function requires Python 3.12 or higher, as it depends on the standard
512513
library function ``random.binomialvariate()``. Raises ``NotImplementedError``
513514
when Python version is too low.
514515

516+
See also: `Random Bitarrays <https://github.com/ilanschnell/bitarray/blob/master/doc/random_p.rst>`__
517+
515518
New in version 3.5
516519

517520

0 commit comments

Comments
 (0)