python mpl_draw always sets rad in connectionstyle
Information
- rustworkx version: 0.17.1
- Python version: 3.15.5
- Rust version: --
- Operating system: Linux
What is the current behavior?
calling mpl_draw with a connection style of bar (goal is to have straight lines) breaks
mpl_draw(
self.graph,
node_color=node_colors,
pos=node_positions,
node_size=node_size,
arrow_size=arrow_size,
connectionstyle='bar'
)
with error TypeError: ConnectionStyle.Bar.__init__() got an unexpected keyword argument 'rad'
What is the expected behavior?
No additional args are added for my custom connection styles that break execution
Steps to reproduce the problem
import matplotlib.pyplot as plt
import rustworkx as rx
from rustworkx.visualization import mpl_draw
G = rx.generators.directed_path_graph(25)
mpl_draw(G, connectionstyle='bar')
Bonus
I've also tried it with to get straight lines
connectionstyle='arc3,rad=0.'
but this most likely also doesn't work since the rad is overwritten by the additional arg that is automatically set here: https://github.com/Qiskit/rustworkx/blob/main/rustworkx/visualization/matplotlib.py#L734
I think this can be fixed. We haven’t tested the Matplotlib drawing with inputs that deviate much from changing edge color and node color, to be honest. But the example in the input is a good first test case