Package mvpa :: Package misc :: Module support
[hide private]
[frames] | no frames]

Module support

source code

Support function -- little helpers in everyday life
Classes [hide private]
  MapOverlap
Compute some overlap stats from a sequence of binary maps.
  HarvesterCall
  Harvester
World domination helper: do whatever it is asked and accumulate results
Functions [hide private]
 
transformWithBoxcar(data, startpoints, boxlength, offset=0, fx=<function mean at 0x85393ac>)
This function transforms a dataset by calculating the mean of a set of patterns.
source code
 
getUniqueLengthNCombinations(data, n)
Generates a list of lists containing all combinations of elements of data of length 'n' without repetitions.
source code
 
indentDoc(v)
Given a value returns a string where each line is indented
source code
 
idhash(val)
Craft unique id+hash for an object
source code
 
isSorted(items)
Check if listed items are in sorted order.
source code
 
getBreakPoints(items, contiguous=True)
Return a list of break points.
source code

Imports: N, re, copy, deepcopy, isSequenceType, debug


Function Details [hide private]

transformWithBoxcar(data, startpoints, boxlength, offset=0, fx=<function mean at 0x85393ac>)

source code 
This function transforms a dataset by calculating the mean of a set of
patterns. Such a pattern set is defined by a starting point and the size
of the window along the first axis of the data ('boxlength').

Parameters:
    data:           An array with an arbitrary number of dimensions.
    startpoints:    A sequence of index value along the first axis of
                    'data'.
    boxlength:      The number of elements after 'startpoint' along the
                    first axis of 'data' to be considered for averaging.
    offset:         The offset between the starting point and the
                    averaging window (boxcar).

The functions returns an array with the length of the first axis being
equal to the length of the 'startpoints' sequence.

getUniqueLengthNCombinations(data, n)

source code 

Generates a list of lists containing all combinations of elements of data of length 'n' without repetitions.

data: list n: integer

This function is adapted from a Java version posted in some forum on the web as an answer to the question 'How can I generate all possible combinations of length n?'. Unfortunately I cannot remember which forum it was.

indentDoc(v)

source code 

Given a value returns a string where each line is indented

Needed for a cleaner __repr__ output v - arbitrary

isSorted(items)

source code 
Check if listed items are in sorted order.
Returns:
True if were sorted. Otherwise False + Warning

Parameters: items: iterable container

getBreakPoints(items, contiguous=True)

source code 
Return a list of break points.
Parameters:
  • items (iterable) - list of items, such as chunks
  • contiguous (bool) - if True (default) then raise Value Error if items are not contiguous, i.e. a label occur in multiple contiguous sets
Returns:
list of indexes for every new set of items