Package pype :: Module pype_aux :: Class ConditionBucket
[frames] | no frames]

Class ConditionBucket

source code

object --+
         |
        ConditionBucket

Instance Methods
 
__init__(self, conditions, randomize=True, freeze=False)
Bucket to hold a set of conditions or stimulus parameters,.
source code
 
reset(self)
Reset the bucket -- usually task shouldn't need to call this.
source code
 
pop(self)
Get next condition from the bucket.
source code
 
push(self, n)
Put condition back in the bucket (if there's an error)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, conditions, randomize=True, freeze=False)
(Constructor)

source code 

Bucket to hold a set of conditions or stimulus parameters,.

Initialize with a list of conditions -- can be any type of sequence object (list, tuple etc) to be provided to the task on-demand.

Parameters:
  • conditions - (list) list of condition descriptions/parameters
  • randomize - (bool) automatically randomize order?
  • freeze - (bool) randomize once and freeze sequence?
Returns:
nothing
Overrides: object.__init__

reset(self)

source code 

Reset the bucket -- usually task shouldn't need to call this.

This resets the bucket back to the starting point, potentially re-randomizing the order. This is automatically called when the bucket on initialization and when the bucket goes empty, so the user should need need to call this directly.

Returns:
nothing

pop(self)

source code 

Get next condition from the bucket.

Automatically refills bucket when it's empty. The index number returned here is what needs to be passed to pop when putting things back in the bucket.

Returns:
tuple (index number of condition, condition, current block/repeat)

push(self, n)

source code 

Put condition back in the bucket (if there's an error)

Automatically refills bucket when it's empty

Returns:
nothing