scatcluster.helper

ScatCluster Helper

Attributes

COLORS

Functions

is_gpu_available()

Check if the GPU is available.

round_nearest(x, a)

Rounds a number x to the nearest multiple of a.

is_notebook(→ bool)

A function to check if the code is running in a Jupyter notebook or IPython terminal.

tqdm_importer()

A function that imports the tqdm module based on the current environment.

demad(x[, factor])

Normalize signal with median absolute deviation.

iter_all_strings()

Generates all possible strings of uppercase letters of increasing length.

list_of_strings(number_letters)

Generates a list of strings of length 'number_letters' using itertools.islice and iter_all_strings.

Module Contents

scatcluster.helper.is_gpu_available()[source]

Check if the GPU is available.

scatcluster.helper.round_nearest(x, a)[source]

Rounds a number x to the nearest multiple of a.

Parameters:
  • x (float) – The number to be rounded.

  • a (float) – The multiple to round to.

Returns:

The rounded number.

Return type:

float

scatcluster.helper.is_notebook() bool[source]

A function to check if the code is running in a Jupyter notebook or IPython terminal.

Returns:

True if running in a Jupyter notebook or qtconsole, False otherwise.

Return type:

bool

scatcluster.helper.tqdm_importer()[source]

A function that imports the tqdm module based on the current environment.

scatcluster.helper.demad(x, factor=10.0)[source]

Normalize signal with median absolute deviation.

Parameters:
  • x (np.ndarray) – The input signal.

  • factor (float, optional) – An additional normalization factor.

Return type:

The data normalized with median absolute deviation.

scatcluster.helper.COLORS = ['0.8', '#222222', '#F3C300', '#875692', '#F38400', '#A1CAF1', '#BE0032', '#C2B280', '#848482',...[source]
scatcluster.helper.iter_all_strings()[source]

Generates all possible strings of uppercase letters of increasing length.

Returns:

A generator that yields all possible strings.

scatcluster.helper.list_of_strings(number_letters)[source]

Generates a list of strings of length ‘number_letters’ using itertools.islice and iter_all_strings.

Parameters:

number_letters (int) – The number of strings to generate.

Returns:

A list of strings of length ‘number_letters’.

Return type:

list