Add a default __str__ that is just the bloq's class name. If you have important (but brief!) parameters, override the __str__ method
I went through all the basic_gates/*.ipynb and verified that they all look reasonable in graphviz form, musical score, and those two forms as part of OnEach (where applicable)
Tests had to be modified because they make assumptions about str(bloq) which isn't really a part of the api and we might want to consider removing these "change detector" tests but I just fixed them in this PR.
where it wouldn't bloq up the diff too much, I moved the "drawing"-type overrides (wire_symbols, str, pretty_name) to the end of the classes.
In the future:
maybe a better default __str__ that picks attributes to include
more manual overrides of __str__ for better looking diagrams
This is a meaningful step towards #791
Fixes #990
__str__
that is just the bloq's class name. If you have important (but brief!) parameters, override the__str__
methodOnEach
(where applicable)str(bloq)
which isn't really a part of the api and we might want to consider removing these "change detector" tests but I just fixed them in this PR.In the future:
__str__
that picks attributes to include__str__
for better looking diagrams__str__
pretty_name