Skip to content

Fix mypy errors in batch 2 files (#1282)#1357

Open
rosspeili wants to merge 2 commits into
quantumlib:mainfrom
rosspeili:fix/issue-1282-mypy-batch2
Open

Fix mypy errors in batch 2 files (#1282)#1357
rosspeili wants to merge 2 commits into
quantumlib:mainfrom
rosspeili:fix/issue-1282-mypy-batch2

Conversation

@rosspeili

Copy link
Copy Markdown
Contributor

Second slice for #1282: mechanical typing fixes in seven files. No API changes; no pyproject.toml change. Safer os.cpu_count() handling when it returns None.

Second slice for quantumlib#1282: mechanical typing fixes in seven files. No API changes; no pyproject.toml change. Safer os.cpu_count() handling when it returns None.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several minor bug fixes, type-safety improvements, and robustness enhancements across the codebase. Key changes include handling None for chemical_potential in mean_field_dwave, refactoring tuple unpacking in prony, adding type-ignore comments to __hash__ overrides, casting a numpy norm to float, and safely calculating MKL_NUM_THREADS to handle cases where os.cpu_count() is None or small. No review comments were provided, so there is no feedback to address.

@rosspeili

Copy link
Copy Markdown
Contributor Author

Pushed a test to cover the chemical_potential=None branch (coverage CI). Remaining failures are the known vpe_circuits_test statistical flake, unrelated to this typing PR.

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.

1 participant