Skip to content

Conversation

coreyostrove
Copy link
Contributor

Note: Since the automatic merge from bugfix into develop didn't work this is just a manual merge of PR #663 into develop.

enielse and others added 2 commits October 7, 2025 15:49
Corrects an indexing bug that would cause DataSet lookups to
silently fail (return incorrect values) when data had been added
with dictionaries that didn't have keys ordered in the same way as
the DataSet's outcome list.  This commit fixes this issue and adds
several unit tests used in debugging.
Corrects an indexing bug that would cause DataSet lookups to silently
fail (return incorrect values) when data had been added with
dictionaries that didn't have keys ordered in the same way as the
DataSet's outcome list. This commit fixes this issue and adds several
unit tests used in debugging.

Previously failing minimal example (now included as a unit test) is:
```
import pygsti

c = "Gxpi2:0@(0)"
counts = {'00': 1, '10': 0, '01': 97, '11': 2}
ds = pygsti.data.DataSet(outcome_labels=["00", "10", "01", "11"], static=False)
ds.add_count_dict(c, counts)
check = ds[c].counts
print(ds)

assert {k[0]: v for k,v in check.items()} == counts
```
@coreyostrove coreyostrove requested review from a team and rileyjmurray as code owners October 9, 2025 01:50
@coreyostrove coreyostrove merged commit 9910707 into develop Oct 9, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants