A set of tools to facilitate code testing
testing
- class timeflux.helpers.testing.DummyData(num_rows=1000, num_cols=5, cols=None, rate=10, jitter=0.05, start_date='2018-01-01', seed=42, round=6)[source]
Generate dummy data.
Initialize the dataframe.
- Parameters
num_rows (int) – Number of rows
num_cols (int) – Number of columns
cols (list) – List of column names
rate (float) – Frequency, in Hertz
jitter (float) – Amount of jitter, relative to rate
start_date (string) – Start date
seed (int) – Seed for random number generation
round (int) – Number of decimals for random numbers
- class timeflux.helpers.testing.DummyXArray(num_time=1000, num_space=5, rate=10, jitter=0.05, start_date='2018-01-01', seed=42, round=6)[source]
Generate dummy data of type XArray.
Initialize the dataframe.
- Parameters
- class timeflux.helpers.testing.ReadData(data)[source]
Generate custom data.
Initialize the dataframe.
- Parameters
data (DataFrame) – custom data to stream.
- class timeflux.helpers.testing.Looper(generator, node, input_port='i', output_port='o')[source]
Mimics the scheduler behavior to allow testing the output of a node offline.
Initialize the helper :param generator (Node): timeflux node to test :param data (Object): data generator object with a method next and reset