Skip to content

Commit

Permalink
Add stim.FlipSimulator.{to_numpy,generate_bernoulli_samples} (#876)
Browse files Browse the repository at this point in the history
- Add `stim.FlipSimulator.generate_bernoulli_samples`
- Add `stim.FlipSimulator.to_numpy`
- Fix bit packed numpy outputs not masking off bits beyond a
non-multiple-of-8 result count
- Fix remaining "doc doesn't include example" warnings from regen_docs
script

Fixes #875

Fixes #877
  • Loading branch information
Strilanc authored Jan 31, 2025
1 parent a0b0321 commit 6afad14
Show file tree
Hide file tree
Showing 14 changed files with 3,928 additions and 44 deletions.
4 changes: 4 additions & 0 deletions dev/util_gen_stub_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"__next__",
}
skip = {
"__firstlineno__",
"__static_attributes__",
"__replace__",
"__builtins__",
"__cached__",
"__getstate__",
Expand Down Expand Up @@ -99,6 +102,7 @@ def splay_signature(sig: str) -> List[str]:
sig = sig.replace('dict[', 'Dict[')
sig = sig.replace('tuple[', 'Tuple[')
sig = sig.replace('set[', 'Set[')
sig = sig.replace('pathlib._local.Path', 'pathlib.Path')

assert sig.startswith('def')
out = []
Expand Down
Loading

0 comments on commit 6afad14

Please sign in to comment.