Skip to content

Commit a09744d

Browse files
committed
Typing issues
1 parent 0887bd3 commit a09744d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

qualtran/drawing/bloq_counts_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def get_graph(self) -> pydot.Dot:
9999

100100
def get_svg_bytes(self) -> bytes:
101101
"""Get the SVG code (as bytes) for drawing the graph."""
102-
return self.get_graph().create(prog='dot', format='svg', encoding='utf-8')
102+
return self.get_graph().create(prog='dot', format='svg', encoding='utf-8') # type: ignore[return-value]
103103

104104
def get_svg(self) -> IPython.display.SVG:
105105
"""Get an IPython SVG object displaying the graph."""

qualtran/drawing/bloq_counts_graph_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_format_counts_graph_markdown():
4848

4949
def _get_node_labels_from_pydot_graph(drawer: _CallGraphDrawerBase) -> List[str]:
5050
graph = drawer.get_graph()
51-
node_labels = [node.get_label() for node in graph.get_node_list()]
51+
node_labels = [node.get_label() for node in graph.get_node_list()] # type: ignore[attr-defined]
5252
random.shuffle(node_labels) # don't rely on order of graphviz nodes
5353
return node_labels
5454

qualtran/drawing/graphviz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def add_cxn(self, graph: pydot.Graph, cxn: Connection) -> pydot.Graph:
340340
graph.add_edge(self.cxn_edge(left, right, cxn))
341341
return graph
342342

343-
def get_graph(self) -> pydot.Dot:
343+
def get_graph(self) -> pydot.Graph:
344344
"""Get the graphviz graph representing the Bloq.
345345
346346
This is the main entry-point to this class.
@@ -360,7 +360,7 @@ def get_graph(self) -> pydot.Dot:
360360

361361
def get_svg_bytes(self) -> bytes:
362362
"""Get the SVG code (as bytes) for drawing the graph."""
363-
return self.get_graph().create(prog='dot', format='svg', encoding='utf-8')
363+
return self.get_graph().create(prog='dot', format='svg', encoding='utf-8') # type: ignore[attr-defined,return-value]
364364

365365
def get_svg(self) -> IPython.display.SVG:
366366
"""Get an IPython SVG object displaying the graph."""

0 commit comments

Comments
 (0)