fault_injector.injector module

fault injector class

class fault_injector.injector.Injector(fault, params: dict = None)[source]

Bases: object

Class designed to help generate and inject faults into data

Parameters:
  • fault – _description_

  • params (dict, optional) – params should include the start and stop keys. These values default to: - start (int): this corresponds to the starting index for the fault. defaults to 0. - stop (int): this corresponds to the ending index for the fault. defaults to -1.

inject_fault(x: ArrayLike) ndarray[source]

Inject the fault into the data

Parameters:

x (ArrayLike) – the original values that will get the fault injected into it

Returns:

the updated values after the fault is injected into it

Return type:

np.ndarray

check_fault_instance(fault)[source]

Check that fault is a fault class instance

Parameters:

fault – fault variable used during initialization

Raises:

TypeError – _description_