Fwd: [Nipy-devel] help with attributes

Brian Hawthorne brian.lee.hawthorne at gmail.com
Wed May 17 19:33:58 CDT 2006


---------- Forwarded message ----------
From: Brian Hawthorne <brian.lee.hawthorne at gmail.com>
Date: May 17, 2006 5:29 PM
Subject: Re: [Nipy-devel] help with attributes
To: Jonathan Taylor <jonathan.taylor at stanford.edu>

hey jonathan,
i've changed the interface of the ParcelIterator a bit so that the attribute
called
labelset must be a sequence (and likewise for the labelset attribute of
SamplingGrid,
which get fed into the ParcelIterator).  looks like i left a few loose
ends.  there
were some cases where the labelset is set to a set object (which is
unordered).
i'll track this down and get back to you.
-brian

On 5/17/06, Jonathan Taylor <jonathan.taylor at stanford.edu> wrote:

> hi all,

need some help with attributes error message: i tried attached pca.py
(in lib/neuroimaging/statistics) example and got the following error:

thanks,

jonathan

--------------------
Traceback (most recent call last):
  File "pca.py", line 177, in ?
    a = p.components(which=[0,2,3])
  File "pca.py", line 109, in components
    outgrid = self.image.grid.subgrid(0)
  File
"/home/jtaylo/python/lib/python2.4/site-packages/neuroimaging/fmri/__init__.py",

line 99, in subgrid
    _grid.labelset = self.labelset
  File "/home/jtaylo/python/lib/python2.4/site-packages/attributes.py",
line 256, in set
    self.validate(value)
  File "/home/jtaylo/python/lib/python2.4/site-packages/attributes.py",
line 211, in validate
    if not self.isvalid(value): raise ProtocolOmission(
protocols.ProtocolOmission: attribute labelset implements (<class
protocols.Sequence at 0xb6ac62fc>,), value set([]) of type <type 'set'>
does not implement: ('__getitem__', '__getslice__')

-----------------------

p.s. does attribute offer the same thing traits does? if yes, should we
be using both? i am kind of used to traits by now...

--
------------------------------------------------------------------------
I'm part of the Team in Training: please support our efforts for the
Leukemia and Lymphoma Society!

http://www.active.com/donate/tntsvmb/tntsvmbJTaylor

GO TEAM !!!

------------------------------------------------------------------------
Jonathan Taylor                           Tel:   650.723.9230
Dept. of Statistics                       Fax:   650.725.8977
Sequoia Hall, 137
www-stat.stanford.edu/~jtaylo<http://www-stat.stanford.edu/%7Ejtaylo>
390 Serra Mall
Stanford, CA 94305



_______________________________________________
Nipy-devel mailing list
Nipy-devel at neuroimaging.scipy.org
http://neuroimaging.scipy.org/mailman/listinfo/nipy-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/nipy-devel/attachments/20060517/30ce28a8/attachment-0002.html 


More information about the Nipy-devel mailing list