rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

Add better Matplotlib tests

Open IvanIsCoding opened this issue 1 year ago • 5 comments

What is the expected enhancement?

Motivated by #1308

Currently our tests only catch serious regressions like image generation failing. We don’t assert anything about the image themselves.

I have little idea about the state of testing Matplotlib, but I think we can improve the current setup

IvanIsCoding avatar Nov 16 '24 03:11 IvanIsCoding

Hi! I’d love to work on this. Could you please suggest if you have a preferred approach for asserting image correctness? Thanks!

Rachel-Eva avatar Apr 28 '25 02:04 Rachel-Eva

@Rachel-Eva I don’t have a preferred approach. I think part of the task is exploring how other libraries do this.

There’s a balance between a test that is too strict and breaks with each matplotlib update. And a test that catches regressions like we had , we were unfortunately shuffling the colours on the plot.

I assigned the issue to you.

IvanIsCoding avatar Apr 28 '25 13:04 IvanIsCoding

@IvanIsCoding Hi! I'll start by checking how libraries like NetworkX and Seaborn, test their Matplotlib plots, and based on that, I'll try adding some tests for the rustworkx plotting functions.

Does that sound good?

Rachel-Eva avatar Apr 28 '25 15:04 Rachel-Eva

Sounds good to me. Also, feel free to make this test Linux only. I am expecting some differences across operating systems. Let’s keep it simple, we just want to catch some obvious errors

IvanIsCoding avatar Apr 28 '25 15:04 IvanIsCoding

Okay, I'm currently using Windows, so I'll set up a VM for Linux and run the tests there.

Rachel-Eva avatar Apr 28 '25 15:04 Rachel-Eva