Structural change to mpl circuit drawer to use class NodeData #10478
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Switch to using NodeData class
Details and comments
Following on #10207 and from a suggestion by @jakelishman, this PR switches to using a NodeData class for storing data used in the drawing elements of a circuit and keyed on the node id. So a previous use such as
node_data[node]["width"]
is nownode_data[node].width
. This improves the readability of the code, provides for descriptions of the attributes in one place, and allows removal of several initialization checks.