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_active
Access Implementors
:listing
,names
,_get_enabled
Mutators
:__init__
,enable
,disable
,_set_enabled
R/O Properties
:listing
,names
,items
R/W Properties
:enabled
Attributes
enabled
Return list of enabled ca listing
Return a list of registered ca along with the documentation Methods
change_temporarily
([enable_ca, disable_ca, ...])Temporarily enable/disable needed ca for computation clear
(() -> None. Remove all items from D.)copy
(\*args, \*\*kwargs)Create a copy of a collection. disable
(key)Disable conditional attribute defined by key
idenable
(key[, value, missingok])Enable conditional attribute given in key
fromkeys
(...)v defaults to None. get
((k[,d]) -> D[k] if k in D, ...)has_key
((k) -> True if D has a key k, else False)is_active
(key)Returns True
if statekey
is known and is enabledis_enabled
(key)Returns True
if statekey
is enabledis_set
([key])If item (or any in the present or listed) was set items
(() -> list of D’s (key, value) pairs, ...)iteritems
(() -> an iterator over the (key, ...)iterkeys
(() -> an iterator over the keys of D)itervalues
(...)keys
(() -> list of D’s keys)pop
((k[,d]) -> v, ...)If key is not found, d is returned if given, otherwise KeyError is raised popitem
(() -> (k, v), ...)2-tuple; but raise KeyError if D is empty. reset
([key])Reset the conditional attribute defined by key
reset_changed_temporarily
()Reset to previousely stored set of enabled ca setdefault
((k[,d]) -> D.get(k,d), ...)update
(source[, copyvalues, memo])Parameters: values
(() -> list of D’s 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
enabled
Return list of enabled ca listing
Return a list of registered ca along with the documentation Methods
change_temporarily
([enable_ca, disable_ca, ...])Temporarily enable/disable needed ca for computation clear
(() -> None. Remove all items from D.)copy
(\*args, \*\*kwargs)Create a copy of a collection. disable
(key)Disable conditional attribute defined by key
idenable
(key[, value, missingok])Enable conditional attribute given in key
fromkeys
(...)v defaults to None. get
((k[,d]) -> D[k] if k in D, ...)has_key
((k) -> True if D has a key k, else False)is_active
(key)Returns True
if statekey
is known and is enabledis_enabled
(key)Returns True
if statekey
is enabledis_set
([key])If item (or any in the present or listed) was set items
(() -> list of D’s (key, value) pairs, ...)iteritems
(() -> an iterator over the (key, ...)iterkeys
(() -> an iterator over the keys of D)itervalues
(...)keys
(() -> list of D’s keys)pop
((k[,d]) -> v, ...)If key is not found, d is returned if given, otherwise KeyError is raised popitem
(() -> (k, v), ...)2-tuple; but raise KeyError if D is empty. reset
([key])Reset the conditional attribute defined by key
reset_changed_temporarily
()Reset to previousely stored set of enabled ca setdefault
((k[,d]) -> D.get(k,d), ...)update
(source[, copyvalues, memo])Parameters: values
(() -> list of D’s 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
other
and listed inenable _ca
. Usereset_enabled_temporarily
to reset to previous state of enabled.other
can be a ClassWithCollections object or ConditionalAttributesCollection
-
disable
(key)¶ Disable conditional attribute defined by
key
id
-
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