Skip to content

Fixed casting numpy vector to int for issue #1000#1039

Closed
DeDuckProject wants to merge 2 commits intoquantumlib:mainfrom
DeDuckProject:bug/AnonTaskStats-worker-fail
Closed

Fixed casting numpy vector to int for issue #1000#1039
DeDuckProject wants to merge 2 commits intoquantumlib:mainfrom
DeDuckProject:bug/AnonTaskStats-worker-fail

Conversation

@DeDuckProject
Copy link
Copy Markdown
Contributor

Resolved Issue #1000

assert isinstance(self.custom_counts, collections.Counter)

if isinstance(self.errors, np.integer):
object.__setattr__(self, 'errors', int(self.errors))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done this way to bypass the frozen attribute? That seems quite brittle.

Strilanc added a commit that referenced this pull request Apr 16, 2026
This was causing problems in a variety of places, and ultimately just isn't very pythonic.

Obsoletes #1039

Fixes #1000
@Strilanc
Copy link
Copy Markdown
Collaborator

Obsoleted by #1056

@Strilanc Strilanc closed this Apr 16, 2026
Strilanc added a commit that referenced this pull request Apr 16, 2026
This was causing problems in a variety of places, and ultimately just
isn't very pythonic.

Obsoletes #1039

Fixes #1000
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