This adds in a fallback to matplotlib in case mayavi fails for some reason (ui backend not installed, VTK error, etc). While matplotlib is slow, it should work on pretty much any machine. I hesitate on adding pptk back, mostly because it's has such specific requirements (python 3.7). I tested this on my ubuntu 20.04 wsl2 instance which comes with python 3.8.10, after intalling PyQt5 manually via pip.
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade pip
$ pip install -e .[viz]
$ python scripts/test_tabletop_estimator.py
...
ImportError: Could not import backend for traitsui. Make sure you
have a suitable UI toolkit like PyQt/PySide or wxPython
installed.
WARNING: Cannot import mayavi. Falling back to matplotlib (slow).
...
Fixes #7.
This adds in a fallback to matplotlib in case mayavi fails for some reason (ui backend not installed, VTK error, etc). While matplotlib is slow, it should work on pretty much any machine. I hesitate on adding pptk back, mostly because it's has such specific requirements (python 3.7). I tested this on my ubuntu 20.04 wsl2 instance which comes with python 3.8.10, after intalling PyQt5 manually via pip.
We can test the matplotlib backend at anytime by forcing it.