MWinPy

class mwinpy.MWin(window_size=3, n_jobs=1)

Initialize moving window

Parameters
  • window_size (int, default=3) – Single integer size which indicates the i,j size of the moving window. E.g. window_size of 3 is equal to a window size of 3,3. Values must be odd numbers due to the way the window size is computed where the window_size // 2 is equal to the number of cells on each side of a cell is needed for a window.

  • n_jobs (int, default=1) – Number of jobs to run in parallel across the CPU. -1 will use all available cores.

matrix

Output similarity matrix reshaped to initial i, j.

Type

ndarray

__init__(window_size=3, n_jobs=1)

Initialize self. See help(type(self)) for accurate signature.

moving_window(arr1, arr2)

Moving window implementation where the number of cores utilized is one.

Parameters
  • arr1 (ndarray) – First array for comparison

  • arr2 (ndarry) – Second array for comparison

Returns

vector – List vector which contains similarity values of each cell

Return type

list

split_moving_window(arr1, arr2, sl)

Moving window implementation where the number of cores utilized is more than one.

Parameters
  • arr1 (ndarray) – First array for comparison

  • arr2 (ndarry) – Second array for comparison

  • sl (list) – Section of arr1 and arr2 which has assigned to CPU core.

Returns

vector – List vector which contains similarity values of each cell

Return type

list