rle_array.testing module

Functionality useful for testing and documentation.

const_col(dims: Iterable[int])str

Name of an constant columns.

Parameters

dims – Dimensions, that describe the column content.

Returns

name – Column name.

Return type

str

Example

>>> from rle_array.testing import const_col
>>> const_col([1, 2])
'const_1_2'
>>> const_col([2, 1])
'const_1_2'
dim_col(d: int)str

Name of an dimension columns.

Parameters

d – Dimension number.

Returns

name – Dimension name.

Return type

str

Example

>>> from rle_array.testing import dim_col
>>> dim_col(1)
'dim_1'
generate_example()pandas.core.frame.DataFrame

Generate example DataFrame for documentation purposes.

Returns

df – Example DataFrame.

Return type

pd.DataFrame

generate_test_dataframe(n_dims: int, size: int)pandas.core.frame.DataFrame

Generates testing data.

Parameters
  • n_dims – Number of dimensions of test cube.

  • size – Size of every dimension (edge length).

Returns

df – Test DataFrame.

Return type

pd.DataFrame