Table Of Contents

Previous topic

misc.args

Next topic

misc.bv.base

This content refers to the previous stable release of PyMVPA. Please visit www.pymvpa.org for the most recent version of PyMVPA and its documentation.

misc.attributes

Module: misc.attributes

Inheritance diagram for mvpa.misc.attributes:

Module with some special objects to be used as magic attributes with dedicated containers aka. Collections.

Classes

AttributeWithUnique

class mvpa.misc.attributes.AttributeWithUnique(name=None, hasunique=True, doc='Attribute with unique')

Bases: mvpa.misc.attributes.CollectableAttribute

Container which also takes care about recomputing unique values

XXX may be we could better link original attribute to additional attribute which actually stores the values (and do reverse there as well).

Pros:
  • don’t need to mess with getattr since it would become just another attribute
Cons:
  • might be worse design in terms of comprehension
  • take care about _set, since we shouldn’t allow change it externally

For now lets do it within a single class and tune up getattr

hasunique
reset()
uniqueValues

CollectableAttribute

class mvpa.misc.attributes.CollectableAttribute(name=None, doc=None, index=None)

Bases: object

Base class for any custom behaving attribute intended to become part of a collection.

Derived classes will have specific semantics:

  • StateVariable: conditional storage
  • AttributeWithUnique: easy access to a set of unique values within a container
  • Parameter: attribute with validity ranges.
    • ClassifierParameter: specialization to become a part of Classifier’s params collection
    • KernelParameter: –//– to become a part of Kernel Classifier’s kernel_params collection

Those CollectableAttributes are to be groupped into corresponding collections for each class by statecollector metaclass, ie it would be done on a class creation (ie not per each object)

isSet
name
reset()

Simply reset the flag

value

DatasetAttribute

class mvpa.misc.attributes.DatasetAttribute(name=None, hasunique=True, doc='Attribute with unique')

Bases: mvpa.misc.attributes.AttributeWithUnique

FeatureAttribute

class mvpa.misc.attributes.FeatureAttribute(name=None, hasunique=True, doc='Attribute with unique')

Bases: mvpa.misc.attributes.AttributeWithUnique

SampleAttribute

class mvpa.misc.attributes.SampleAttribute(name=None, hasunique=True, doc='Attribute with unique')

Bases: mvpa.misc.attributes.AttributeWithUnique

StateVariable

class mvpa.misc.attributes.StateVariable(name=None, enabled=True, doc='State variable')

Bases: mvpa.misc.attributes.CollectableAttribute

Simple container intended to conditionally store the value

enable(value=False)
isEnabled
reset()

Simply detach the value, and reset the flag