[MMTK] Vector Madness

Dr. Seth Olsen seth.olsen at gmail.com
Fri Sep 22 07:00:58 CEST 2006


Hi Konrad (and MMTKers),

Please disregard my last message to you and to the list.  I forgot a
parentheses and only spotted it during my checking of the code AFTER posting
the problem.  Indeed I was passing an instancemethod, as the error
indicated.

Cheers,

seth

On 9/22/06, Dr. Seth Olsen <seth.olsen at gmail.com> wrote:
>
>
> Hi MMTKers,
>
> My problems with vectors have not gone away, and are persisting despite
> such efforts as blowing away my Scientific2.511 distribution and
> reinstalling it, as well as doing same and removing the
> Scientific_vector.pyx.  The latest manifestation occurs as so:
>
> Traceback (most recent call last):
>   File "<stdin>", line 416, in ?
>   File "<stdin>", line 413, in main
>   File "<stdin>", line 348, in VMDDump
>   File "<stdin>", line 272, in VMDVectorLines
>   File
> "/usr/lib/python2.4/site-packages/Scientific/Geometry/VectorModule.py", line
> 72, in __add__
>     return Vector(self.array+other.array)
> AttributeError: 'function' object has no attribute 'array'
>
> In this case the Vector class is imported via 'from
> Scientific.Geometry.VectorModule import Vector'.  If I instead use 'from
> Scientific.Geometry import Vector' (which I understand invokes the pyx
> vector class), I get:
>
> Traceback (most recent call last):
>   File "<stdin>", line 416, in ?
>   File "<stdin>", line 413, in main
>   File "<stdin>", line 348, in VMDDump
>   File "<stdin>", line 272, in VMDVectorLines
>   File "Scientific_vector.pyx", line 74, in
> Scientific_vector.vector.__add__
> TypeError: Argument 'self' has incorrect type (expected
> Scientific_vector.vector, got instancemethod)
>
> I'm not sure what the problem is (and I've included the code I'm writing
> as attachment - I don't know if it will be useful because it import other
> modules that I haven't attached).  As far as I can tell it seems to be that
> the offending vector has been passed as an attribute of an instance of a
> class, but I'm not sure.  In the attached script (as can be seen), the
> vectors that are added to produce either error are read in from external
> sources as arrays and clearly declared as vectors which are then attached to
> instances of particular classes which serve as specialized data structures.
>
>
> Can someone illuminate the issue?
>
> Cheers,
>
> Seth
>
>
>
> On 9/20/06, Konrad Hinsen <hinsen at cnrs-orleans.fr > wrote:
> >
> > On Sep 19, 2006, at 15:39, Dr. Seth Olsen wrote:
> >
> > > Traceback (most recent call last):
> > >   File "<stdin>", line 37, in ?
> > >   File "/usr/lib/python2.4/site-packages/MMTK/Collections.py", line
> > > 246, in normalizePosition
> > >     self.translateTo(Vector(0., 0., 0.))
> > >   File "/usr/lib/python2.4/site-packages/MMTK/Collections.py", line
> > > 243, in translateTo
> > >     self.translateBy(position-self.centerOfMass())
> > >   File "/usr/lib/python2.4/site-packages/MMTK/Collections.py", line
> > > 86, in centerOfMass
> > >     mr = mr + a._mass * a.position(conf)
> > >   File "Scientific_vector.pyx", line 74, in
> > > Scientific_vector.vector.__add__
> > > TypeError: Argument 'other' has incorrect type (expected
> > > Scientific_vector.vector, got array)
> >
> > Which version of ScientificPython are you using? This works fine for
> > me using the latest one (2.5.11).
> >
> > On Sep 19, 2006, at 17:57, Dr. Seth Olsen wrote:
> >
> > > Upon looking into the archives, I think I found the solution: to
> > > delete the Scientific_vector.so file so that the original python
> > > code is used.  If I'm wrong, I'll find out soon enough.
> >
> > If you have an old Scientific with a buggy Pyrex vector class, that's
> > a solution indeed.
> >
> > > By the way, was the issue with the not-so-good fit via
> > > findTransformation() ever solved?  That function works now for me
> > > (as does most everything - thanks to everyone's help) but I must
> > > admit that I've seen better rms fits from fortran qtrfit codes...
> >
> > The function is supposed to produce the best fit possible using
> > translation and rotation. If you have a case for which some other
> > code produces a better fit, I'd like to see it to check what's going
> > wrong.
> >
> > Konrad.
> > --
> > ---------------------------------------------------------------------
> > Konrad Hinsen
> > Centre de Biophysique Moléculaire, CNRS Orléans
> > Synchrotron Soleil - Division Expériences
> > Saint Aubin - BP 48
> > 91192 Gif sur Yvette Cedex, France
> > Tel. +33-1 69 35 97 15
> > E-Mail: hinsen at cnrs-orleans.fr
> > ---------------------------------------------------------------------
> >
> >
> >
>
>
> --
> ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms
>
> Dr Seth Olsen, PhD
> Postdoctoral Fellow, Biomolecular Modeling Group
> Centre for Computational Molecular Science
> Australian Institute for Bioengineering and Nanotechnology (Bldg. 75)
> The University of Queensland
> Qld 4072, Brisbane, Australia
>
> tel (617) 3346 3976
> fax (617) 33654623
> email: s.olsen1 at uq.edu.au
> Web: www.ccms.uq.edu.au
>
> ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms
> The opinions expressed here are my own and do not reflect the positions of
> the University of Queensland.
>
>


-- 
ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms

Dr Seth Olsen, PhD
Postdoctoral Fellow, Biomolecular Modeling Group
Centre for Computational Molecular Science
Australian Institute for Bioengineering and Nanotechnology (Bldg. 75)
The University of Queensland
Qld 4072, Brisbane, Australia

tel (617) 3346 3976
fax (617) 33654623
email: s.olsen1 at uq.edu.au
Web: www.ccms.uq.edu.au

ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms
The opinions expressed here are my own and do not reflect the positions of
the University of Queensland.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://starship.python.net/pipermail/mmtk/attachments/20060922/15f9480d/attachment.htm


More information about the mmtk mailing list