Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error when providing edge_color to draw_chimera_embedding or other drawing functions.

Open
#256 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Start with drawing/qubit_layout.py in draw_embedding, where the traceback shows the conflicting edge_color argument, and compare how drawing/chimera_layout.py and the Pegasus embedding wrapper pass arguments through. Reproduce the provided example and confirm that edge_color works for the affected drawing functions without raising an error.

Written by the indexing model from the issue text.

Description

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 https://github.com/dwavesystems/dwave-networkx/issues/162 and https://github.com/dwavesystems/dwave-networkx/pull/158, but has not been fixed yet.

Dominant language
Python
Stars
94
Forks
62
Avg merge
13h 11m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwavesystems/dwave-graphs

All issues in dwavesystems/dwave-graphs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.