-
Notifications
You must be signed in to change notification settings - Fork 48
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
Mypy issues part 3 #898
Conversation
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops
qualtran/bloqs/factoring/mod_mul.py
Outdated
@@ -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)) |
There was a problem hiding this comment.
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*~
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
bc: Dict[Bloq, Union[int, sympy.Expr]] | ||
) -> Tuple[Union[int, sympy.Expr], Union[int, sympy.Expr]]: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groovy
Looks like a legitimate conflict with #867 -- which was just merged. |
More miscellaenous mypy fixes.