[ase-users] Python 2+3 compatible ase-gui
Alexander Held
alexander.held at fmf.uni-freiburg.de
Mon Jan 16 12:02:17 CET 2017
> -----Ursprüngliche Nachricht-----
> Von: Jens Jørgen Mortensen [mailto:jensj at fysik.dtu.dk]
> Gesendet: Freitag, 13. Januar 2017 13:55
> An: Alexander Held; ase-users at listserv.fysik.dtu.dk
> Betreff: Re: AW: [ase-users] Python 2+3 compatible ase-gui
>
> On 01/13/2017 11:21 AM, Alexander Held wrote:
> > Thank you very much for the nice work.
> >
> > A quick test gave me these issues (with both py2.7 and py3.5):
> >
> > 1) When selecting many atoms, the chemical formula shown in the bottom
> > sometimes contains garbage like "C12\u2088" instead of "C128" (the
> > "12" and "128" are subscript)
> > 2) The matplotlib energy plot pops up as a window with a title, but the
> canvas just contains garbage from the video buffer (e.g. content of other
> windows). I use matplotlib, numpy, python from Anaconda on 64bit linux.
> > 3) Selecting "Edit->Modify" without selecting any atoms, I get this
> traceback (example for py27 case, similar for py35):
> >
> > Exception in Tkinter callback
> > Traceback (most recent call last):
> > File "/j1c/held/opt/Anaconda2-4.1.1-Linux-x86_64/lib/python2.7/lib-
> tk/Tkinter.py", line 1537, in __call__
> > return self.func(*args)
> > File "/j1c/held/opt/ase-master/ase/gui/ui.py", line 399, in callback2
> > callback(key)
> > File "/j1c/held/opt/ase-master/ase/gui/gui.py", line 269, in
> modify_atoms
> > ModifyAtoms(self)
> > File "/j1c/held/opt/ase-master/ase/gui/modify.py", line 15, in __init__
> > ui.oops(_('No atoms selected!'))
> > AttributeError: 'module' object has no attribute 'oops'
> >
> > 4) The "Edit->Modify" dialog has no OK or CANCEL buttons. It took me quite
> some time to figure out that I have to hit "return" to change e.g. the
> element. Just closing the dialog does not modify anything.
> >
> > For me, issue 2) is the most serious, since I use ase-gui a lot to make the
> matplotlib plots. Unfortunately, there is no error message. I can only tell that
> the plots work fine with the old ase-gui version and the same matplotlib.
>
> Thanks for your feedback. I've fixed 3 and 4.
>
> About 2: Does you matplotlib have a tkinter backend? I was hoping that
> matplotlib would always come with a tkinter backend. If that's not the case
> then I'll go back to doing the plotting in a separate process (as before when
> we always had problems with missing GTK-backend in MPL).
Using your latest fixes from version 3.12.0-446-g3faa28b, the matplotlib plots work just fine. About the tkinter backend: I am not sure, which one would be a tkinter backend. The closest match from "matplotlib.rcsetup.all_backends" I found was "TkAgg" and the following code works fine for me:
from __future__ import print_function
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as pp
pp.plot([1, 2], [3, 4])
print(matplotlib.get_backend())
pp.show()
Alexander Held
>
> About 1: Looks like your tkinter can't show a unicode subscript-8 ...
> I'll see if I can find a solution.
>
> Jens Jørgen
>
> > Kind regards
> > Alexander Held
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: ase-users-bounces at listserv.fysik.dtu.dk [mailto:ase-users-
> >> bounces at listserv.fysik.dtu.dk] Im Auftrag von Jens Jørgen Mortensen
> >> via ase-users
> >> Gesendet: Mittwoch, 11. Januar 2017 11:36
> >> An: ase-users
> >> Betreff: [ase-users] Python 2+3 compatible ase-gui
> >>
> >> Hi!
> >>
> >> I have finally managed to port ase-gui to Python 3. I'd like some
> >> feedback before we make an ase-3.13 release.
> >>
> >> It's a slightly trimmed down version of ase-gui with some
> >> features/functionality removed. So, if you feel something important
> >> is missing, then please let me know.
> >>
> >> Install the development version and then give it a try. Please try
> >> with both Python 2 and 3. You can do that like this:
> >>
> >> $ python2 -m ase.gui ...
> >> $ python3 -m ase.gui ...
> >>
> >> Make sure that you are actually testing the new GUI: Click Help ->
> >> About, and you should see "ASE-GUI (work in progress)".
> >>
> >> You can clone the code or download a development-snapshot as
> >> described
> >> here:
> >>
> >> https://wiki.fysik.dtu.dk/ase/install.html#installation-from-source
> >>
> >> or get it from PyPI:
> >>
> >> $ pip install ase==3.13.0b1 --user
> >> $ pip3 install ase==3.13.0b1 --user
> >>
> >> Please report any bugs you find.
> >>
> >> Jens Jørgen
> >>
> >> _______________________________________________
> >> ase-users mailing list
> >> ase-users at listserv.fysik.dtu.dk
> >> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
More information about the ase-users
mailing list