nansencenter / DAPPER

Data Assimilation with Python: a Package for Experimental Research

Home Page:https://nansencenter.github.io/DAPPER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MPL backend installation

patnr opened this issue · comments

Right now QtAgg is among the "extras" of setup.py.
That could mean an interactive matplotlib (mpl) backend might not get installed unless using pip install -e .[Qt].

However, I almost always seem to get an interactive backend installed anyways. My recent fresh install came with both MacOSX and TkAgg backends. I have a feeling it is because the environment was created with Anaconda, which provides some things to begin with, but I'm not sure.

So:

  • How to guarantee installation of an interactive backend?
  • Should we require using one in particular, or (somehow) make it platform dependent? For example,
    • I believe Qt5Agg is cross-platform, and can be installed via pip only, but slower & uglier than MacOSX.
    • I believe TkAgg is cross-platform, but might require complicated installation instructions beyond pip. However, Anaconda seems (?) to provide it automatically.

@yumengch Thoughts?

I would suggest TkAgg.

Tkinter is part of the standard library and I also found some online info:

Tkinter is included in the Python 3 core.

So I think tk is bundled with Python instead of Anaconda.

I tested with a very clean windows installation and tk is already there.

With a clean conda environment in my Ubuntu system, tk is installed automatically with Python installation as well.
clean_python_install

I'm not sure about the situation on OS X, but I hope it's the same there.

  • I cannot comment on issue #41 yet. I will come back with that later, I think.

Good points for TkAgg. But it's painfully slow on my Mac with liveplotting. And prone to crash. Same goes for Qt5Agg actually (although it's really smooth on Linux). I think it's so bad that's it's almost unusable. I guess that's why Anaconda provides MacOSX by default.

Therefore I think we need to need to let it be platform dependent. It seems Anaconda figures this out quite well by itself. But I would still like to be able to guarantee that an interactive backend is installed. I will dig a little deeper into Anaconda to find out.

I now think that:

With cross-platform compatibility in mind, and the messy world/state of GUI mpl backends, guaranteeing an interactive backend seems too complicated.

The installation instructions suggest using Jupyter, which will always provide an interactive backend. Most other relevant platforms and python distributions also tend to result in an interactive backend.

Thus, simply emitting a warning when we detect that mpl is non-interactive (and non-inline) should be sufficient.