iblrig.misc

Provides collection of functionality used throughout the iblrig repository.

Assortment of functions, frequently used, but without a great deal of commonality. Functions can, and should, be broken out into their own files and/or classes as the organizational needs of this repo change over time.

Functions

draw_contrast

Draw a contrast value from a given iterable based to the specified probability type.

get_biased_probs

Calculate biased probabilities for all elements of an array such that the i`th value has probability `p_i for being drawn relative to the remaining values.

get_port_events

get_session_path

Returns the session path from any filepath if the date/number pattern is found.

get_task_argument_parser

Return the task's argument parser.

get_task_arguments

Parse input to run the tasks. All the variables are fed to the Session instance task.py -s subject_name -p projects_name -c procedures_name --no-interactive :param extra_args: list of dictionaries of additional argparse arguments to add to the parser For example, to add a new toto and titi arguments, use: get_task_arguments({'--toto', type=str, default='toto'}, {'--titi', action='store_true', default=False}) :return:.

online_std

Update the mean and standard deviation of a group of values after a sample update.

truncated_exponential

Generate a truncated exponential random variable within a specified range.