[MMTK] ParticleVectors and __float__ attributes
Dr. Seth Olsen
seth.olsen at gmail.com
Mon Sep 18 16:10:51 CEST 2006
Hi MMTKers,
I had a try at working around the error I was getting from Subspace.getBasis(),
namely:
Traceback (most recent call last):
File "<stdin>", line 67, in ?
File "/usr/lib/python2.4/site-packages/MMTK/Subspace.py", line 79, in
getBasis
basis = Numeric.array(self.vectors, Numeric.Float)
AttributeError: ParticleVector instance has no attribute '__float__'
by adding a __float__ attribute to the ParticleVector class as such:
def __float__(self):
return Numeric.array(self.array,Numeric.Float)
but this doesn't work, giving instead a different error:
File "<stdin>", line 67, in ?
File "/usr/lib/python2.4/site-packages/MMTK/Subspace.py", line 79, in
getBasis
basis = Numeric.array(self.vectors, Numeric.Float)
TypeError: nb_float should return float object
This is quite perplexing, as I can't be the first one to run into this bug.
I'm giving up for the evening. I will try again tomorrow.
Cheers,
Seth
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/20060919/1a59413a/attachment.html
More information about the mmtk
mailing list