mvpa2.base.state.ConditionalAttributesCollection¶
-
class
mvpa2.base.state.ConditionalAttributesCollection(items=None, name=None)¶ Container of ConditionalAttributes for a stateful object.
Groups: Public Access Functions:has_key,is_enabled,is_activeAccess Implementors:listing,names,_get_enabledMutators:__init__,enable,disable,_set_enabledR/O Properties:listing,names,itemsR/W Properties:enabled
Attributes
enabledReturn list of enabled ca listingReturn a list of registered ca along with the documentation Methods
change_temporarily([enable_ca, disable_ca, …])Temporarily enable/disable needed ca for computation clear()copy(*args, **kwargs)Create a copy of a collection. disable(key)Disable conditional attribute defined by keyidenable(key[, value, missingok])Enable conditional attribute given in keyfromkeys(S[,v])v defaults to None. get(k[,d])has_key(k)is_active(key)Returns Trueif statekeyis known and is enabledis_enabled(key)Returns Trueif statekeyis enabledis_set([key])If item (or any in the present or listed) was set items()iteritems()iterkeys()itervalues()keys()pop(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised popitem()2-tuple; but raise KeyError if D is empty. reset([key])Reset the conditional attribute defined by keyreset_changed_temporarily()Reset to previousely stored set of enabled ca setdefault(k[,d])update(source[, copyvalues, memo])Parameters: values()viewitems()viewkeys()viewvalues()which_set()Return list of keys which were set Initialize the conditional attributes of a derived class
Parameters: items : dict
dictionary of ca
name : str
literal description. Usually just attribute name for the collection, e.g. ‘ca’
Attributes
enabledReturn list of enabled ca listingReturn a list of registered ca along with the documentation Methods
change_temporarily([enable_ca, disable_ca, …])Temporarily enable/disable needed ca for computation clear()copy(*args, **kwargs)Create a copy of a collection. disable(key)Disable conditional attribute defined by keyidenable(key[, value, missingok])Enable conditional attribute given in keyfromkeys(S[,v])v defaults to None. get(k[,d])has_key(k)is_active(key)Returns Trueif statekeyis known and is enabledis_enabled(key)Returns Trueif statekeyis enabledis_set([key])If item (or any in the present or listed) was set items()iteritems()iterkeys()itervalues()keys()pop(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised popitem()2-tuple; but raise KeyError if D is empty. reset([key])Reset the conditional attribute defined by keyreset_changed_temporarily()Reset to previousely stored set of enabled ca setdefault(k[,d])update(source[, copyvalues, memo])Parameters: values()viewitems()viewkeys()viewvalues()which_set()Return list of keys which were set -
change_temporarily(enable_ca=None, disable_ca=None, other=None)¶ Temporarily enable/disable needed ca for computation
Enable or disable ca which are enabled in
otherand listed inenable _ca. Usereset_enabled_temporarilyto reset to previous state of enabled.othercan be a ClassWithCollections object or ConditionalAttributesCollection
-
disable(key)¶ Disable conditional attribute defined by
keyid
-
enable(key, value=True, missingok=False)¶ Enable conditional attribute given in
key
-
enabled¶ Return list of enabled ca
Parameters: nondefault : bool
Either to return also ca which are enabled simply by default
invert : bool
Would invert the meaning, ie would return disabled ca
-
reset_changed_temporarily()¶ Reset to previousely stored set of enabled ca

