A class implementing a basic experiment.
Methods
Create an experiment.
Parameters : | name : str, optional
foreground_colour : (int, int, int), optional background_colour : (int,int,int), optional text_font : str, optional text_size : int, optional filename_suffix : str, optional
|
---|
Add a block to the experiment.
Parameters : | block : design.Block
copies : int, optional
|
---|
Add a between subject factor.
The defined between subject factor conditions will be permuted across the subjects. Factors that are added first are treated as hierarchically higher factors while permutation.
Parameters : | factor_name : str
conditions : list
|
---|
Add data variable names to the design.
Parameters : | variables : str or lst of str
|
---|
Add experiment information to the design.
Parameters : | text : string or list of str
|
---|
Getter for background_colour.
Getter for block_list_factor_names.
Get all factor names defined in all blocks.
Getter for blocks.
Getter for factors keys.
Getter for bws_factor_randomized.
Notes
Is between subject factor randomized? (True/False).
If True conditions will be assigned randomized otherwise (default) conditions will be systematically permuted across subjects.
Remove all blocks from experiment.
Remove all between subject factors from design.
Remove all data variable names from design.
Getter for global clock.
Getter for main data file.
Getter for data_variable_names.
Getter for desing_as_text.
Trial list as csv table.
Getter for main event files.
Getter for experiment_info.
Getter for filename suffix.
Find the position of a block, given the id.
Parameters : | id : int
|
---|---|
Returns : | pos: int :
|
Getter for foreground_colour.
Return all conditions of this between subject factor.
Get the between subject factor condition for a subject.
The condition for the current subject will be returned, if expyriment is running and the function is called without a subject_id. If the function is called with a subject_id, the condition for this particular subject will be returned.
Parameters : | factor_name : str subject_id : str, optional
|
---|---|
Returns : | cond : str
|
Getter for is_initialized.
Getter for is_started.
Getter for global keyboard.
Load the design from a csv file containing list of trials.
The function considers only the defined trial factors and not the added stimuli. The existing design will be deleted.
Parameters : | filename : str
encoding : str, optional
|
---|
Notes
The current version of this function does not handle between_subject factors and data_variables.
Log the design (as comment) to the current main event file.
If no experiment is initialized or no event file exists the function will not do anything. This function will be automatically called after an experiment has been started.
Parameters : | additional_comment : str, optional
|
---|
Notes
See also save_design().
Getter for event logging.
Getter for global keyboard.
Getter for n_blocks.
Number of blocks.
Getter for n_bws_factor_conditions.
Total number of conditions in all bws_factors.
Getter for name.
Order the blocks.
Parameters : | order : list
|
---|
Permute the blocks.
Parameters : | permutation_type : int (permutation type)
factor_names : list (of strings), optional
subject_id : int, optional
|
---|
Register a wait callback function.
Parameters : | function : function
|
---|
Notes
CAUTION! If wait callback function takes longer than 1 ms to process, Expyriment timing will be affected!
The registered wait callback function will be repetitively executed in all Expyriment wait and event loops that wait for an external input. That is, they are executed by the following functions (at least once!):
Remove block from experiment.
If no position is given, the last one is removed.
Parameters : | position : int
|
---|
Save the design as list of trials to a csv file.
The function considers only the defined trial factors and not the added stimuli.
Parameters : | filename : str
|
---|
Notes
The current version of this function does not handle between_subject factors and data_variables.
Getter for global screen.
Set the log level of the current experiment
Parameters : | loglevel : int
|
---|
Notes
There are three event logging levels:
In most cases, it should be avoided to switch of logging (loglevel=0). It log files become to big due to certain repetitive events, it is suggested to switch of the logging of individual stimuli or IO event. (see the method .set_logging() of this objects)
The logging of events can be also changed before initialize via the default value expyriment.control.defaults.event_logging.
Shuffle all blocks.
Sort the blocks according to their indices from low to high.
Getter for global subject id.
Swap two blocks.
Parameters : | position1 : int
position2 : int
|
---|
Getter for text_font.
Getter for text_size.
Getter for trial_factor_nanes.
Get all factor names defined in the trial lists of all blocks.
Unregister wait function.