|
From: Leonhard H. <Leo...@ur...> - 2016-12-01 12:40:58
|
I guess formatting didn't work out as i expected. So once again and
hopefully formatted:
Hi!
I stumbled upon some odd behavior when starting PyMol in an interactive
IPython Session.
PyMol can be launched from interactive IPython like this:
In [1]: import pymol
In [2]: from pymol import cmd
In [3]: pymol.finish_launching()
In [4]: cmd.fetch("1xyz")
So far, everything is normal.
However, when I want to get the coordinates of the structure the
following happens:
In [5]: cmd.get_coords("1xyz")
Out[5]:
array([[ 41., 25., 36.],
[ 40., 25., 35.],
[ 39., 24., 35.], ...,
[ 11., 26., 67.],
[ 4., 32., 95.],
[ 22., 45., 49.]], dtype=float32)
Even though the datatype is float32 apparently the decimals got lost
somehow.
The coordinates of the first atom should be: 41.511 25.152 36.876
Repeating the above in a normal interactive Python Session everything
works just fine:
>>> import pymol
>>> from pymol import cmd
>>> pymol.finish_launching()
>>> cmd.fetch("1xyz")
>>> cmd.get_coords("1xyz")
array([[ 41.51100159, 25.15200043, 36.87599945],
[ 40.9070015 , 25.55500031, 35.56299973],
[ 39.68399811, 24.70700073, 35.10599899], ...,
[ 11.88700008, 26.97699928, 67.03900146],
[ 4.45699978, 32.77299881, 95.16600037],
[ 22.64100075, 45.7840004 , 49.03900146]], dtype=float32)
As I use IPython only for debugging of PyMol scripts/plugins this is not
a very big problem.
Still I'm interested in what causes this strange behavior. Is it a
problem/bug in IPython or in PyMol?
Maybe someone has more insights here and can give clarity!
Using Python 2.7.12, IPython 5.1.0 and PyMol 1.8.4.0
Thanks!
regards
Leonhard
|