Skip to content

Error when providing edge_color to draw_chimera_embedding or other drawing functions. #256

Description

@KoheiSuda

Description
When edge_color is provided to draw_chimera_embedding or draw_pegasus_embedding function, an error is thrown

Traceback (most recent call last):
  File "/home/shoeki/quan/b.py", line 6, in <module>
    dnx.draw_chimera_embedding(G, emb, width=0.5, show_labels=True, edge_color=["red"])
  File "/home/shoeki/quan/venv/lib/python3.12/site-packages/dwave_networkx/drawing/chimera_layout.py", line 282, in draw_chimera_embedding
    draw_embedding(G, chimera_layout(G), *args, **kwargs)
  File "/home/shoeki/quan/venv/lib/python3.12/site-packages/dwave_networkx/drawing/qubit_layout.py", line 365, in draw_embedding
    draw(G, layout, nodelist=nodelist, edgelist=background_edgelist,
TypeError: networkx.drawing.nx_pylab.draw() got multiple values for keyword argument 'edge_color'

To Reproduce
Here is a minimal code example

import dwave_networkx as dnx

G = dnx.chimera_graph(16, 16, 4)
emb = {"a": [0], "b": [1]}
dnx.draw_chimera_embedding(G, emb, width=0.5, show_labels=True, edge_color=["red"])

Expected behavior
A graph should be drawn without error

Environment:

  • OS: WSL 2.5.9.0 (Ubuntu)
  • Python version: 3.12.3
  • dwave-networkx==0.8.18

Additional context
This issue is a similar error to #162 and #158, but has not been fixed yet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions