API Reference
Otava Test Data - Test data generators and Visualization for Apache Otava change point detection.
This package provides generators for creating synthetic time series data with known change points for testing and visualizing change point detection algorithms.
- class otava_test_data.TimeSeries(data: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]], change_points: list[~otava_test_data.generators.basic.ChangePoint] = <factory>, generator_name: str = '', parameters: dict = <factory>)[source]
Bases:
objectContainer for time series data with change point metadata.
- data
The time series values as a numpy array.
- Type:
numpy.ndarray[tuple[Any, …], numpy.dtype[numpy.float64]]
- change_points
List of known change points in the series.
- Type:
- generator_name
Name of the generator that created this series.
- Type:
str
- parameters
Dictionary of parameters used to generate the series.
- Type:
dict
- change_points: list[ChangePoint]
- data: ndarray[tuple[Any, ...], dtype[float64]]
- generator_name: str = ''
- property length: int
Return the length of the time series.
- parameters: dict
- otava_test_data.banding(length: int, value1: float = 100.0, value2: float = 105.0, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a banding time series - oscillating randomly between two values.
S = x1, x2, x2, x1, x2, x1, x1, x1, x2, x2, x1, x2, x2…
Banding is a form of noise (unwanted change) where results oscillate randomly between two values. Typically: - abs(x2 - x1) << x1 (the band gap is small relative to values) - When random noise is mixed in: x1, x2 > std dev
- Parameters:
length – Number of data points.
value1 – First band value.
value2 – Second band value.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with banding pattern (no explicit change points).
- otava_test_data.combine(*series_list: TimeSeries, operation: str = 'add') TimeSeries[source]
Combine multiple time series using the specified operation.
This allows creating complex patterns by combining basic building blocks. For example: step_function + noise_normal creates a step with realistic noise.
- Parameters:
*series_list – Variable number of TimeSeries to combine.
operation – How to combine values: - “add”: Sum the values (default) - “multiply”: Multiply the values - “concatenate”: Join series end-to-end
- Returns:
Combined TimeSeries with merged change points.
Example
>>> step = step_function(100, value_before=100, value_after=120) >>> noise = noise_normal(100, mean=0, sigma=5) >>> combined = combine(step, noise, operation="add")
- otava_test_data.constant(length: int, value: float = 100.0, seed: int | None = None) TimeSeries[source]
Generate a constant time series: S = x, x, x, x…
This represents an ideal performance test with no variation.
- Parameters:
length – Number of data points (typically 50 or 500).
value – The constant value.
seed – Random seed (unused, for API consistency).
- Returns:
TimeSeries with constant values and no change points.
Example
>>> ts = constant(length=100, value=50.0) >>> all(v == 50.0 for v in ts.data) True
- otava_test_data.multiple_changes(length: int, values: list[float] | None = None, change_indices: list[int] | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple consecutive changes.
S = x0, x0, x0… x1, x2, … xn, xn, xn…
Where x0 < x1 < x2 … < xn (monotonically increasing) or any other sequence of distinct values.
This represents multiple independent improvements or regressions merged back to back in performance testing.
- Parameters:
length – Number of data points.
values – List of values for each segment. If None, defaults to [100, 110, 120, 130] (three changes).
change_indices – List of indices where changes occur. Must have len(values) - 1 elements. If None, evenly distributed.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple step change points.
Example
>>> ts = multiple_changes(100, values=[100, 120, 140], change_indices=[30, 60]) >>> len(ts.change_points) 2
- otava_test_data.noise_normal(length: int, mean: float = 100.0, sigma: float = 5.0, seed: int | None = None, bounded: bool = True) TimeSeries[source]
Generate normally distributed noise: S = x1, x2, x3… where X ~ N(mean, sigma).
This represents typical performance test output with random variation. When bounded=True, values are clipped to within 4 standard deviations (99.99% percentile), making it possible for algorithms to correctly detect 100% of cases.
- Parameters:
length – Number of data points.
mean – Mean of the distribution.
sigma – Standard deviation.
seed – Random seed for reproducibility.
bounded – If True, clip values to mean +/- 4*sigma.
- Returns:
TimeSeries with normally distributed values and no change points.
- otava_test_data.noise_uniform(length: int, min_val: float = 90.0, max_val: float = 110.0, seed: int | None = None) TimeSeries[source]
Generate uniformly distributed noise (white noise): S = random(min, max).
Also known as static noise. All values are equally likely within the range.
- Parameters:
length – Number of data points.
min_val – Minimum value.
max_val – Maximum value.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with uniformly distributed values and no change points.
- otava_test_data.outlier(length: int, baseline: float = 100.0, outlier_value: float = 150.0, outlier_index: int | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with a single outlier (anomaly).
S = x, x, x, x, x, x’, x, x… where x’ != x
An outlier is a single deviating point, which may be indistinguishable from a very short regression (single point).
- Parameters:
length – Number of data points.
baseline – The normal/baseline value.
outlier_value – The outlier value.
outlier_index – Position of the outlier. If None, placed at length//2.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one outlier marked as a change point.
- otava_test_data.phase_change(length: int, amplitude: float = 10.0, baseline: float = 100.0, period: int = 20, change_index: int | None = None, phase_shift: float = 1.5707963267948966, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with constant mean and variance but phase changes.
S = cos(x)…, sin(x)…
The underlying periodic pattern shifts phase at a point. While periodic patterns are not typical in performance testing (mentioned in spec as things we do NOT encounter), this is included for completeness in testing detection algorithms.
- Parameters:
length – Number of data points.
amplitude – Amplitude of the oscillation.
baseline – Baseline value around which oscillation occurs.
period – Number of points per cycle.
change_index – Position of the phase change. If None, placed at length//2.
phase_shift – Amount of phase shift in radians (default pi/2 = cos to sin).
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one phase change point.
- otava_test_data.regression_fix(length: int, value_normal: float = 100.0, value_regression: float = 130.0, value_fixed: float | None = None, regression_start: int | None = None, regression_duration: int = 10, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a regression followed by a fix.
S = x1, x1… x2, …x2, x3, x3, x3…
The amount of x2 points is small compared to x1 and x3, but at least 2 points. Special case: x1 == x3 (fixed back to original value). Special case: x2 is a single point (indistinguishable from outlier).
- Parameters:
length – Number of data points.
value_normal – Normal/baseline value (x1).
value_regression – Value during regression (x2).
value_fixed – Value after fix (x3). If None, defaults to value_normal.
regression_start – Index where regression begins. If None, placed at length//3.
regression_duration – How many points in the regression state (minimum 2).
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with regression and fix change points.
- otava_test_data.step_function(length: int, value_before: float = 100.0, value_after: float = 120.0, change_index: int | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a step function (single change point).
S = x1, x1, x1, x2, x2, x2, x2…
This represents a performance regression or improvement that persists.
- Parameters:
length – Number of data points.
value_before – Value before the change point.
value_after – Value after the change point.
change_index – Position of the change. If None, placed at length//2.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one step change point.
- otava_test_data.variance_change(length: int, mean: float = 100.0, sigma_before: float = 2.0, sigma_after: float = 10.0, change_index: int | None = None, seed: int | None = None) TimeSeries[source]
Generate a time series with constant mean but changing variance.
S = N(mean, sigma1)…, N(mean, sigma2)…
The mean stays the same, but the spread of values changes at a point. This can indicate a change in test stability or environmental factors.
- Parameters:
length – Number of data points.
mean – Mean value (constant throughout).
sigma_before – Standard deviation before change point.
sigma_after – Standard deviation after change point.
change_index – Position of the variance change. If None, placed at length//2.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one variance change point.
Basic building block time series generators.
These generators create fundamental time series patterns used in performance testing scenarios. Each generator returns a TimeSeries object containing the data and metadata about any change points present.
- class otava_test_data.generators.basic.ChangePoint(index: int, change_type: str, before_value: float | None = None, after_value: float | None = None, description: str = '')[source]
Bases:
objectRepresents a change point in a time series.
- after_value: float | None = None
Mean/value after the change point.
- before_value: float | None = None
Mean/value before the change point.
- change_type: str
‘step’, ‘outlier’, ‘variance’, ‘regression_start’, ‘regression_end’.
- Type:
Type of change
- description: str = ''
Human-readable description of this change point.
- index: int
Index where the change occurs.
- class otava_test_data.generators.basic.TimeSeries(data: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.float64]], change_points: list[~otava_test_data.generators.basic.ChangePoint] = <factory>, generator_name: str = '', parameters: dict = <factory>)[source]
Bases:
objectContainer for time series data with change point metadata.
- data
The time series values as a numpy array.
- Type:
numpy.ndarray[tuple[Any, …], numpy.dtype[numpy.float64]]
- change_points
List of known change points in the series.
- Type:
- generator_name
Name of the generator that created this series.
- Type:
str
- parameters
Dictionary of parameters used to generate the series.
- Type:
dict
- change_points: list[ChangePoint]
- data: ndarray[tuple[Any, ...], dtype[float64]]
- generator_name: str = ''
- property length: int
Return the length of the time series.
- parameters: dict
- otava_test_data.generators.basic.constant(length: int, value: float = 100.0, seed: int | None = None) TimeSeries[source]
Generate a constant time series: S = x, x, x, x…
This represents an ideal performance test with no variation.
- Parameters:
length – Number of data points (typically 50 or 500).
value – The constant value.
seed – Random seed (unused, for API consistency).
- Returns:
TimeSeries with constant values and no change points.
Example
>>> ts = constant(length=100, value=50.0) >>> all(v == 50.0 for v in ts.data) True
- otava_test_data.generators.basic.noise_normal(length: int, mean: float = 100.0, sigma: float = 5.0, seed: int | None = None, bounded: bool = True) TimeSeries[source]
Generate normally distributed noise: S = x1, x2, x3… where X ~ N(mean, sigma).
This represents typical performance test output with random variation. When bounded=True, values are clipped to within 4 standard deviations (99.99% percentile), making it possible for algorithms to correctly detect 100% of cases.
- Parameters:
length – Number of data points.
mean – Mean of the distribution.
sigma – Standard deviation.
seed – Random seed for reproducibility.
bounded – If True, clip values to mean +/- 4*sigma.
- Returns:
TimeSeries with normally distributed values and no change points.
- otava_test_data.generators.basic.noise_uniform(length: int, min_val: float = 90.0, max_val: float = 110.0, seed: int | None = None) TimeSeries[source]
Generate uniformly distributed noise (white noise): S = random(min, max).
Also known as static noise. All values are equally likely within the range.
- Parameters:
length – Number of data points.
min_val – Minimum value.
max_val – Maximum value.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with uniformly distributed values and no change points.
- otava_test_data.generators.basic.outlier(length: int, baseline: float = 100.0, outlier_value: float = 150.0, outlier_index: int | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with a single outlier (anomaly).
S = x, x, x, x, x, x’, x, x… where x’ != x
An outlier is a single deviating point, which may be indistinguishable from a very short regression (single point).
- Parameters:
length – Number of data points.
baseline – The normal/baseline value.
outlier_value – The outlier value.
outlier_index – Position of the outlier. If None, placed at length//2.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one outlier marked as a change point.
- otava_test_data.generators.basic.regression_fix(length: int, value_normal: float = 100.0, value_regression: float = 130.0, value_fixed: float | None = None, regression_start: int | None = None, regression_duration: int = 10, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a regression followed by a fix.
S = x1, x1… x2, …x2, x3, x3, x3…
The amount of x2 points is small compared to x1 and x3, but at least 2 points. Special case: x1 == x3 (fixed back to original value). Special case: x2 is a single point (indistinguishable from outlier).
- Parameters:
length – Number of data points.
value_normal – Normal/baseline value (x1).
value_regression – Value during regression (x2).
value_fixed – Value after fix (x3). If None, defaults to value_normal.
regression_start – Index where regression begins. If None, placed at length//3.
regression_duration – How many points in the regression state (minimum 2).
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with regression and fix change points.
- otava_test_data.generators.basic.step_function(length: int, value_before: float = 100.0, value_after: float = 120.0, change_index: int | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a step function (single change point).
S = x1, x1, x1, x2, x2, x2, x2…
This represents a performance regression or improvement that persists.
- Parameters:
length – Number of data points.
value_before – Value before the change point.
value_after – Value after the change point.
change_index – Position of the change. If None, placed at length//2.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one step change point.
Advanced time series generators for more complex phenomena.
These generators create patterns that represent more nuanced behaviors seen in real performance testing scenarios.
- otava_test_data.generators.advanced.banding(length: int, value1: float = 100.0, value2: float = 105.0, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a banding time series - oscillating randomly between two values.
S = x1, x2, x2, x1, x2, x1, x1, x1, x2, x2, x1, x2, x2…
Banding is a form of noise (unwanted change) where results oscillate randomly between two values. Typically: - abs(x2 - x1) << x1 (the band gap is small relative to values) - When random noise is mixed in: x1, x2 > std dev
- Parameters:
length – Number of data points.
value1 – First band value.
value2 – Second band value.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with banding pattern (no explicit change points).
- otava_test_data.generators.advanced.banding_uniform(length: int, value1: float = 100.0, value2: float = 105.0, noise_range: float = 4.0, seed: int | None = None) TimeSeries[source]
Banding pattern with uniform noise.
- otava_test_data.generators.advanced.multiple_banding(length: int, value_pairs: list[tuple[float, float]] | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple banding segments.
Each segment oscillates between a different pair of values.
- Parameters:
length – Number of data points.
value_pairs – List of (value1, value2) tuples for each segment. If None, defaults to 3 segments with different pairs.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple banding segments.
- otava_test_data.generators.advanced.multiple_changes(length: int, values: list[float] | None = None, change_indices: list[int] | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple consecutive changes.
S = x0, x0, x0… x1, x2, … xn, xn, xn…
Where x0 < x1 < x2 … < xn (monotonically increasing) or any other sequence of distinct values.
This represents multiple independent improvements or regressions merged back to back in performance testing.
- Parameters:
length – Number of data points.
values – List of values for each segment. If None, defaults to [100, 110, 120, 130] (three changes).
change_indices – List of indices where changes occur. Must have len(values) - 1 elements. If None, evenly distributed.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple step change points.
Example
>>> ts = multiple_changes(100, values=[100, 120, 140], change_indices=[30, 60]) >>> len(ts.change_points) 2
- otava_test_data.generators.advanced.multiple_outliers(length: int, baseline: float = 100.0, outlier_value: float = 150.0, outlier_indices: list[int] | None = None, n_outliers: int = 3, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple outliers.
Extension of the single outlier case - multiple isolated anomalous points.
- Parameters:
length – Number of data points.
baseline – The normal/baseline value.
outlier_value – The outlier value(s).
outlier_indices – Specific indices for outliers. If None, randomly placed.
n_outliers – Number of outliers if outlier_indices is None.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple outlier change points.
- otava_test_data.generators.advanced.multiple_phase_changes(length: int, amplitude: float = 10.0, baseline: float = 100.0, period: int = 20, n_changes: int = 3, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple phase changes.
A periodic signal that undergoes multiple phase shifts.
- Parameters:
length – Number of data points.
amplitude – Amplitude of the periodic signal.
baseline – Baseline/center value.
period – Period of the oscillation.
n_changes – Number of phase changes.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple phase change points.
- otava_test_data.generators.advanced.multiple_regression_fix(length: int, value_normal: float = 100.0, value_regression: float = 130.0, n_regressions: int = 3, regression_duration: int | None = None, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple regression+fix cycles.
Multiple temporary regressions that each get fixed, returning to normal.
- Parameters:
length – Number of data points.
value_normal – The normal/baseline value.
value_regression – The regression value.
n_regressions – Number of regression cycles.
regression_duration – Duration of each regression. If None, auto-calculated.
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple regression+fix change points.
- otava_test_data.generators.advanced.multiple_variance_changes(length: int, mean: float = 100.0, sigmas: list[float] | None = None, change_indices: list[int] | None = None, seed: int | None = None) TimeSeries[source]
Generate a time series with multiple variance changes.
Extension of variance_change - variance changes multiple times while mean stays constant.
- Parameters:
length – Number of data points.
mean – Constant mean value.
sigmas – List of sigma values for each segment.
change_indices – Indices where variance changes occur.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with multiple variance change points.
- otava_test_data.generators.advanced.outlier_uniform(length: int, baseline: float = 100.0, outlier_value: float = 150.0, outlier_index: int | None = None, noise_range: float = 10.0, seed: int | None = None) TimeSeries[source]
Single outlier with uniform noise.
- otava_test_data.generators.advanced.phase_change(length: int, amplitude: float = 10.0, baseline: float = 100.0, period: int = 20, change_index: int | None = None, phase_shift: float = 1.5707963267948966, sigma: float = 0.0, seed: int | None = None) TimeSeries[source]
Generate a time series with constant mean and variance but phase changes.
S = cos(x)…, sin(x)…
The underlying periodic pattern shifts phase at a point. While periodic patterns are not typical in performance testing (mentioned in spec as things we do NOT encounter), this is included for completeness in testing detection algorithms.
- Parameters:
length – Number of data points.
amplitude – Amplitude of the oscillation.
baseline – Baseline value around which oscillation occurs.
period – Number of points per cycle.
change_index – Position of the phase change. If None, placed at length//2.
phase_shift – Amount of phase shift in radians (default pi/2 = cos to sin).
sigma – If > 0, add normal noise with this standard deviation.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one phase change point.
- otava_test_data.generators.advanced.phase_change_uniform(length: int, amplitude: float = 10.0, baseline: float = 100.0, period: int = 20, change_index: int | None = None, noise_range: float = 4.0, seed: int | None = None) TimeSeries[source]
Phase change with uniform noise.
- otava_test_data.generators.advanced.regression_fix_uniform(length: int, value_normal: float = 100.0, value_regression: float = 130.0, regression_start: int | None = None, regression_duration: int = 20, noise_range: float = 10.0, seed: int | None = None) TimeSeries[source]
Regression + fix pattern with uniform noise.
- otava_test_data.generators.advanced.step_function_uniform(length: int, value_before: float = 100.0, value_after: float = 120.0, change_index: int | None = None, noise_range: float = 10.0, seed: int | None = None) TimeSeries[source]
Step function with uniform noise.
- otava_test_data.generators.advanced.variance_change(length: int, mean: float = 100.0, sigma_before: float = 2.0, sigma_after: float = 10.0, change_index: int | None = None, seed: int | None = None) TimeSeries[source]
Generate a time series with constant mean but changing variance.
S = N(mean, sigma1)…, N(mean, sigma2)…
The mean stays the same, but the spread of values changes at a point. This can indicate a change in test stability or environmental factors.
- Parameters:
length – Number of data points.
mean – Mean value (constant throughout).
sigma_before – Standard deviation before change point.
sigma_after – Standard deviation after change point.
change_index – Position of the variance change. If None, placed at length//2.
seed – Random seed for reproducibility.
- Returns:
TimeSeries with one variance change point.
Combiner module for composing time series building blocks.
Provides utilities to combine multiple time series patterns and generate all possible combinations of building blocks.
- class otava_test_data.generators.combiner.CombinationGenerator(lengths: list[int] | None = None, seed: int | None = None)[source]
Bases:
objectGenerator for creating all combinations of building block time series.
This class systematically generates combinations of basic patterns for comprehensive testing of change point detection algorithms.
- generate_all_basic() dict[str, list[TimeSeries]][source]
Generate all basic time series for each length.
- Returns:
Dictionary mapping generator name to list of TimeSeries (one per length).
- generate_all_test_cases(include_combinations: bool = True, noise_levels: list[float] | None = None) list[TimeSeries][source]
Generate comprehensive set of test cases.
This is the main entry point for generating test data for Otava.
- Parameters:
include_combinations – Whether to include pairwise combinations.
noise_levels – List of noise sigmas to apply.
- Returns:
List of all generated TimeSeries.
- generate_basic_blocks() list[tuple[str, Callable[[...], TimeSeries]]][source]
Get list of basic building block generators.
- Returns:
List of (name, generator_function) tuples.
- generate_pairwise_combinations(add_noise_sigma: float = 5.0) list[TimeSeries][source]
Generate all pairwise combinations of building blocks.
For each pair of pattern types, combines them using addition. E.g., step_function + outlier, banding + variance_change, etc.
- Parameters:
add_noise_sigma – Noise to add to combined series.
- Returns:
List of combined TimeSeries.
- generate_with_noise_variants(sigmas: list[float] | None = None) list[TimeSeries][source]
Generate all basic patterns, each with different noise levels.
- Parameters:
sigmas – List of noise standard deviations to apply. Defaults to [0, 2, 5, 10].
- Returns:
List of all generated TimeSeries.
- otava_test_data.generators.combiner.add_noise(series: TimeSeries, sigma: float = 5.0, distribution: str = 'normal', seed: int | None = None) TimeSeries[source]
Add noise to an existing time series.
Convenience function to add realistic noise to any pattern.
- Parameters:
series – The base time series.
sigma – Standard deviation (for normal) or half-range (for uniform).
distribution – “normal” or “uniform”.
seed – Random seed for reproducibility.
- Returns:
New TimeSeries with noise added.
- otava_test_data.generators.combiner.combine(*series_list: TimeSeries, operation: str = 'add') TimeSeries[source]
Combine multiple time series using the specified operation.
This allows creating complex patterns by combining basic building blocks. For example: step_function + noise_normal creates a step with realistic noise.
- Parameters:
*series_list – Variable number of TimeSeries to combine.
operation – How to combine values: - “add”: Sum the values (default) - “multiply”: Multiply the values - “concatenate”: Join series end-to-end
- Returns:
Combined TimeSeries with merged change points.
Example
>>> step = step_function(100, value_before=100, value_after=120) >>> noise = noise_normal(100, mean=0, sigma=5) >>> combined = combine(step, noise, operation="add")
- otava_test_data.generators.combiner.generate_test_suite(output_dir: str = 'test_data', lengths: list[int] | None = None, seed: int = 42) list[str][source]
Generate a complete test suite and save to CSV files.
- Parameters:
output_dir – Directory to save CSV files.
lengths – Time series lengths to generate.
seed – Random seed for reproducibility.
- Returns:
List of generated file paths.