Skip to content

Commit

Permalink
add release date - update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanschnell committed Oct 15, 2024
1 parent f9c7b7b commit 20a322f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 67 deletions.
2 changes: 1 addition & 1 deletion CHANGE_LOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2024-10-XX 3.0.0:
2024-10-15 3.0.0:
-------------------
* see [Bitarray 3 transition](bitarray3.rst)
* remove Python 2.7 support
Expand Down
28 changes: 10 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,11 @@ bitarray methods:
``decode(code, /)`` -> iterator
Given a prefix code (a dict mapping symbols to bitarrays, or ``decodetree``
object), decode content of bitarray and return an iterator over
the symbols.
corresponding symbols.

New in version 3.0: returns iterator - equivalent to ``.iterdecode()``.
See also: `Bitarray 3 transition <https://github.com/ilanschnell/bitarray/blob/master/doc/bitarray3.rst>`__

New in version 3.0: returns iterator (equivalent to past ``.iterdecode()``).


``encode(code, iterable, /)``
Expand Down Expand Up @@ -584,20 +586,6 @@ bitarray methods:
New in version 1.5.3: optional index argument.


``iterdecode(code, /)`` -> iterator
alias for ``.decode()`` - deprecated since bitarray 3.0.0

New in version 3.0: deprecated, use ``.decode()``.


``itersearch(sub_bitarray, start=0, stop=<end>, /, right=False)`` -> iterator
alias for ``.search()`` - deprecated since bitarray 3.0.0

New in version 2.9: optional start and stop arguments - add optional keyword argument ``right``.

New in version 3.0: deprecated, use ``.search()``.


``pack(bytes, /)``
Extend bitarray from a bytes-like object, where each byte corresponds
to a single bit. The byte ``b'\x00'`` maps to bit 0 and all other bytes
Expand Down Expand Up @@ -631,7 +619,11 @@ bitarray methods:
unless ``right=True``, which will iterate in descending oder (starting with
rightmost match).

New in version 3.0: returns iterator - equivalent to ``.itersearch()``.
See also: `Bitarray 3 transition <https://github.com/ilanschnell/bitarray/blob/master/doc/bitarray3.rst>`__

New in version 2.9: optional start and stop arguments - add optional keyword argument ``right``.

New in version 3.0: returns iterator (equivalent to past ``.itersearch()``).


``setall(value, /)``
Expand Down Expand Up @@ -700,7 +692,7 @@ Other objects:

``decodetree(code, /)`` -> decodetree
Given a prefix code (a dict mapping symbols to bitarrays),
create a binary tree object to be passed to ``.decode()`` or ``.iterdecode()``.
create a binary tree object to be passed to ``.decode()``.

New in version 1.6.

Expand Down
23 changes: 23 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
Change log
==========

**3.0.0** (2024-10-15):

* see `Bitarray 3 transition <bitarray3.rst>`__
* remove Python 2.7 support
* ``.decode()`` now returns iterator (equivalent to past ``.iterdecode()``)
* ``.search()`` now returns iterator (equivalent to past ``.itersearch()``)
* remove ``.iterdecode()`` and ``.itersearch()``
* remove ``util.rindex()``, use ``.index(..., right=1)`` instead,
deprecated since 2.9
* remove ``util.make_endian()``, use ``bitarray(..., endian=...)`` instead,
deprecated since 2.9
* remove hackish support for ``bitarray()`` handling unpickling,
see detailed explaination in `#207 <https://github.com/ilanschnell/bitarray/issues/207>`__ - closes `#206 <https://github.com/ilanschnell/bitarray/issues/206>`__


**2.9.3** (2024-10-10):

* add official Python 3.13 support
* update cibuildwheel to 2.21.3
* minor simplifications
* fix some typos


**2.9.2** (2024-01-01):

* optimize initialization from strings by not constantly resizing buffer
Expand Down
69 changes: 21 additions & 48 deletions doc/reference.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Reference
=========

bitarray version: 2.9.2 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__
bitarray version: 3.0.0 -- `change log <https://github.com/ilanschnell/bitarray/blob/master/doc/changelog.rst>`__

In the following, ``item`` and ``value`` are usually a single bit -
an integer 0 or 1.
Expand Down Expand Up @@ -102,9 +102,14 @@ bitarray methods:
New in version 2.9: add non-overlapping sub-bitarray count.


``decode(code, /)`` -> list
``decode(code, /)`` -> iterator
Given a prefix code (a dict mapping symbols to bitarrays, or ``decodetree``
object), decode content of bitarray and return it as a list of symbols.
object), decode content of bitarray and return an iterator over
corresponding symbols.

See also: `Bitarray 3 transition <https://github.com/ilanschnell/bitarray/blob/master/doc/bitarray3.rst>`__

New in version 3.0: returns iterator (equivalent to past ``.iterdecode()``).


``encode(code, iterable, /)``
Expand Down Expand Up @@ -173,22 +178,6 @@ bitarray methods:
New in version 1.5.3: optional index argument.


``iterdecode(code, /)`` -> iterator
Given a prefix code (a dict mapping symbols to bitarrays, or ``decodetree``
object), decode content of bitarray and return an iterator over
the symbols.


``itersearch(sub_bitarray, start=0, stop=<end>, /, right=False)`` -> iterator
Return iterator over indices where sub_bitarray is found, such that
sub_bitarray is contained within ``[start:stop]``.
The indices are iterated in ascending order (from lowest to highest),
unless ``right=True``, which will iterate in descending oder (starting with
rightmost match).

New in version 2.9: optional start and stop arguments - add optional keyword argument ``right``.


``pack(bytes, /)``
Extend bitarray from a bytes-like object, where each byte corresponds
to a single bit. The byte ``b'\x00'`` maps to bit 0 and all other bytes
Expand All @@ -215,11 +204,18 @@ bitarray methods:
Reverse all bits in bitarray (in-place).


``search(sub_bitarray, limit=<none>, /)`` -> list
Searches for given sub_bitarray in self, and return list of start
positions.
The optional argument limits the number of search results to the integer
specified. By default, all search results are returned.
``search(sub_bitarray, start=0, stop=<end>, /, right=False)`` -> iterator
Return iterator over indices where sub_bitarray is found, such that
sub_bitarray is contained within ``[start:stop]``.
The indices are iterated in ascending order (from lowest to highest),
unless ``right=True``, which will iterate in descending oder (starting with
rightmost match).

See also: `Bitarray 3 transition <https://github.com/ilanschnell/bitarray/blob/master/doc/bitarray3.rst>`__

New in version 2.9: optional start and stop arguments - add optional keyword argument ``right``.

New in version 3.0: returns iterator (equivalent to past ``.itersearch()``).


``setall(value, /)``
Expand Down Expand Up @@ -288,7 +284,7 @@ Other objects:

``decodetree(code, /)`` -> decodetree
Given a prefix code (a dict mapping symbols to bitarrays),
create a binary tree object to be passed to ``.decode()`` or ``.iterdecode()``.
create a binary tree object to be passed to ``.decode()``.

New in version 1.6.

Expand Down Expand Up @@ -345,29 +341,6 @@ This sub-module was added in version 1.2.
New in version 1.8.


``make_endian(bitarray, /, endian)`` -> bitarray
When the endianness of the given bitarray is different from ``endian``,
return a new bitarray, with endianness ``endian`` and the same elements
as the original bitarray.
Otherwise (endianness is already ``endian``) the original bitarray is returned
unchanged.

New in version 1.3.

New in version 2.9: deprecated - use ``bitarray()``.


``rindex(bitarray, sub_bitarray=1, start=0, stop=<end>, /)`` -> int
Return rightmost (highest) index where sub_bitarray (or item - defaults
to 1) is found in bitarray (``a``), such that sub_bitarray is contained
within ``a[start:stop]``.
Raises ``ValueError`` when the sub_bitarray is not present.

New in version 2.3.0: optional start and stop arguments.

New in version 2.9: deprecated - use ``.index(..., right=1)``.


``strip(bitarray, /, mode='right')`` -> bitarray
Return a new bitarray with zeros stripped from left, right or both ends.
Allowed values for mode are the strings: ``left``, ``right``, ``both``
Expand Down

0 comments on commit 20a322f

Please sign in to comment.