Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy issues part 3 #898

Merged
merged 7 commits into from
Apr 29, 2024
Merged

Mypy issues part 3 #898

merged 7 commits into from
Apr 29, 2024

Conversation

dstrain115
Copy link
Contributor

More miscellaenous mypy fixes.

More miscellaenous mypy fixes.
@@ -107,7 +108,7 @@ def short_name(self) -> str:
def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
if self.is_adjoint:
# inverting inequality tests at zero Toffoli.
return {}
return set()
Copy link
Collaborator

Choose a reason for hiding this comment

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

whoops

@@ -215,13 +218,13 @@ def _generalize_k(b: Bloq) -> Optional[Bloq]:
return b


@bloq_example(generalizer=(ignore_split_join, ignore_alloc_free, _generalize_k))
@bloq_example(None, generalizer=(ignore_split_join, ignore_alloc_free, _generalize_k))
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this required? Kindof ruins the ~*aesthetic*~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this was my first attempt, but the root problem was that the override in bloq_example was missing a default. I missed reverting these after I discovered that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cool, that's what I was hoping you'd say :)

Comment on lines +50 to +51
bc: Dict[Bloq, Union[int, sympy.Expr]]
) -> Tuple[Union[int, sympy.Expr], Union[int, sympy.Expr]]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very optional for this and future PRs, but wanted to bring your attention to qualtran.resource_counting.symbolic_counting_utils.SymbolicInt as an alias for Union[int, sympy.Expr].

Also I might move these symbolic utils to a more easily importable location -- perhaps top-level. But that's todo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know. I will use that in the future. Yeah, that type is fairly well hidden.

Copy link
Collaborator

@mpharrigan mpharrigan left a comment

Choose a reason for hiding this comment

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

groovy

@mpharrigan
Copy link
Collaborator

Looks like a legitimate conflict with #867 -- which was just merged.

@dstrain115 dstrain115 merged commit 44a86a8 into quantumlib:main Apr 29, 2024
6 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