-
Notifications
You must be signed in to change notification settings - Fork 72
Remove pretty_name part 3 #1402
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
Remove pretty_name part 3 #1402
Conversation
Change the default implementation of Bloq.pretty_name to go via str. Removing pretty_name implementations and moving them to str or wire_symbols as necessary. This change removes all references to pretty_name
nice. can you fix the two notebooks as well? |
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.
Hold off on merging until I cut v0.5
Ok, notebooks fixed. Feel free to merge when ready |
qualtran/_infra/adjoint.py
Outdated
def pretty_name(self) -> str: | ||
"""The subbloq's pretty_name with a dagger.""" | ||
return self.subbloq.pretty_name() + '†' | ||
|
||
def __str__(self) -> str: | ||
"""Delegate to subbloq's `__str__` method.""" | ||
return f'Adjoint(subbloq={str(self.subbloq)})' |
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.
could we use str(subbloq) + dagger
in __str__
instead of Adjoint(subloq=...)
? It would make the diagrams easier to read.
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.
Done.
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.
+1, I wanted to do this for a while; but feared the test changes that would need to accompany it
Change the default implementation of Bloq.pretty_name to go via str. Removing pretty_name implementations and moving them to str or wire_symbols as necessary.
This change removes all references to pretty_name