-
Notifications
You must be signed in to change notification settings - Fork 983
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
GateFamily: add tags to str representation #5312
Conversation
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.
Add tests for this. Otherwise, looks fine to me.
The default description change broken the JSON serialization test because the old description was captured in Cirq/cirq-core/cirq/ops/gateset.py Lines 223 to 224 in c0c0e5f
The old description no longer matches the new default description, so the repr contains a non-empty description, creating a conflict. My proposed fix is to leave name and description empty in the JSON if they match the default, just like what we do for repr. IMO repr and json serialization logic should be similar ideally, and if the default name and description are used, there's no value in storing the full name and description anyway. As part of making this change, I also modified the existing objects in |
Oof, to fix the presubmit failure, there's a bunch of GateFamilies in |
Discussed with @tanujkhattar offline. Opted to go with the solution which causes the least breakages to unblock the PR, which is to keep the logic the same and fix the description in |
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.
Looks great!
@tanujkhattar