scikit-learn-contrib / metric-learn

Metric learning algorithms in Python
http://contrib.scikit-learn.org/metric-learn/
MIT License
1.4k stars 234 forks source link

[Minor] GUI for matplotlib to run examples #323

Closed mvargas33 closed 3 years ago

mvargas33 commented 3 years ago

If you try to run the examples on a fresh virtual environment, no figure will be shown and you will end up with the following error:

UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

I propose to add pyqt5 to 'demo' dependencies. This is a package with a GUI that works for matplotlib. This solves the issue.

bellet commented 3 years ago

Thanks @mvargas33. I am not quite familiar with these GUI aspects and their potential dependencies. Perhaps @perimosocordiae can validate as well

perimosocordiae commented 3 years ago

I don't think we need to specify QT as a dependency here, there are several matplotlib backends that should all work reasonably well and I wouldn't want to make users download the QT backend if they aren't going to use it.

Maybe the best change here is a comment in the demo noting that a graphical matplotlib backend is recommended.

mvargas33 commented 3 years ago

I followed @perimosocordiae recommendation and added a note in the docs for sandwich and algorithms walkthrough instead. That should be enough.