-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
BitArray.from_counts
/from_samples
to not fail for input with …
…only `0` outcome and `num_bits=None` (#12800) * interpret `0` as represented by 1 bit * Test conversion of counts w only `0` outcome * add release note
- Loading branch information
1 parent
898fdec
commit c40ce83
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/fix-bitarray-fromcounts-nobits-82958a596b3489ec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed a bug in :meth:`.BitArray.from_counts` and :meth:`.BitArray.from_samples`. | ||
Previously these would raise an error if given data containing only zeros, and no | ||
value for the optional argument ``num_bits``. Now they produce a :class:`.BitArray` | ||
with :attr:`.BitArray.num_bits` set to 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters