Array-based NumPy trace step templates

Include interface into your IDE

NumPy trace step templates are implemented against the abstract class AbstractNumpyBasedTraceStep. You can add the interface to your project to enable autocompletion and type hints in your external IDE via the ecu.test Interface Python Library ecutest-interface.

AbstractNumpyBasedTraceStep

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.AbstractNumpyBasedTraceStep

Interface definition for array-based NumPy trace step templates.

Your trace step template class must inherit from this interface. There are some utility functions available: FitToAxis, CalculateRanges, and CalculateMaskForRange.

abstractmethod static GetInterfaceRevision() → int

Returns the interface revision of the trace step template.

Return the actual value of NUMPY_TRACESTEP_REVISION when implementing a new step. Do not import or dynamically resolve the revision from the installed interface package, because this method must describe the revision the concrete trace step was generated for.

Note:

This method is auto-generated for new implementations of AbstractNumpyBasedTraceStep. So do not delete or modify this method!

Info

Interface method: Has to be overridden by child class.

classmethod GetDescription() → str

Returns the description of the trace step.

Info

Interface method: Can be overridden by child class.

abstractmethod classmethod GetSignals() → list[SignalDefinition]

Returns the incoming and outgoing signals of the trace step.

Info

Interface method: Has to be overridden by child class in order

to use signals in trace step template.

classmethod GetParameters() → list[ParameterDefinition]

Returns the input and return parameters of the trace step.

Info

Interface method: Has to be overridden by child class in order

to use parameters in trace step template.

classmethod GetTimeAxisDefinition() → str

Returns how the common time axis is determined. Only the logical operators and and or as well as references to the time axes of the signals by using the signal name are permitted. The use of brackets is allowed.

Note:

If a signal is not defined on the common time axis, its value is determined according to its interpolation rule.

Returns:

Convention for building the common time axis (e.g. ‘Sig1 or Sig2’). If an empty string is returned, all time axes are merged into one common time axis. This corresponds to an OR concatenation of the individual time axes.

Info

Interface method: Can be overridden by child class.

Check(parameters: dict[str, Any]) → None

Is called initially before trace analysis execution and should check the parameterization. In case of error, raise a TypeError or ValueError.

Parameters:
parameters: dict[str, Any]

Dictionary of parameter values.

Raises:
  • TypeError – Invalid type of a parameter.

  • ValueError – Invalid value of a parameter.

Info

Interface method: Should be overridden by child class.

abstractmethod Process(parameters: dict[str, Any], report: Report, timeAxis: numpy.ndarray, ranges: list[TriggerRange], signals: dict[str, Signal]) → None

Method for executing the trace step template. Calculations can be performed based on the given signal values and their results can be stored in outgoing signals. Evaluation results and return parameters can be set.

Note:

It is recommended to evaluate over the given trigger ranges and set the result for each trigger range. The overall result will be automatically determined.

It is possible to manually set the overall result using the Report object; the automatic mechanism will be deactivated if used.

Detailed spots are also reported on trigger ranges.

Note:

Access to values: All signal values within a trigger range can be accessed by its TriggerRange object. Alternatively, all values of a signal can be accessed by the Signal object.

Note:

To store calculated values in an outgoing signal the Signal object is used: Signal.Emit(timestamps, values)

Parameters:
parameters: dict[str, Any]

Dictionary of parameter values.

report: Report

The report object.

timeAxis: numpy.ndarray

The common time axis of the signals over the entire trace. A limitation to the trigger ranges can be provided by a TriggerRange object.

ranges: list[TriggerRange]

List of trigger ranges.

signals: dict[str, Signal]

Dictionary of signals.

Info

Interface method: Has to be overridden by child class.

static FitToAxis(timestamps: numpy.ndarray, values: numpy.ndarray, targetTimeArray: numpy.ndarray, leftFillValue: object = None, rightFillValue: object = None) → numpy.ndarray

Maps a signal to a target time axis. Interpolates between timestamps using sample-and-hold if necessary.

Parameters:
timestamps: numpy.ndarray

Time axis of the signal.

values: numpy.ndarray

Values of the signal.

targetTimeArray: numpy.ndarray

Target time axis.

leftFillValue: object = None

Values before the first sample of the signal are defined by this value. If None, numpy.NAN is used. If values is a Boolean array and any numpy.NAN is applied the resulting array will be converted from bool to float!

rightFillValue: object = None

Values after the last sample of the signal are defined by this value. If None, the last signal value is used.

Returns:

Value array containing the signal values mapped to targetTimeArray.

static CalculateRanges(boolArray: numpy.ndarray) → list[tuple[int, int, bool]]

Searches boolArray for ‘True ranges’ and ‘False ranges’ and creates ‘from-to-tuples’.

Parameters:
boolArray: numpy.ndarray

Array containing truth values.

Returns:

List with a (start, stop, truth value) tuple per range.

static CalculateMaskForRange(array: numpy.ndarray, minVal: int | float | None = None, maxVal: int | float | None = None, leftOpen: bool = False, rightOpen: bool = False) → numpy.ndarray

Calculate a mask that fits all values that are in the interval [minVal, maxVal]. Both minVal and maxVal are optional.The interval is closed per default. The parameters leftOpen and rightOpen can be used to change this behavior.

Note:

This method can be used to calculate the mask for a signal’s time axis which then is applied to the signal values to get all values in a given time range.

Note:

There is no special handling for NaN values. Avoid NaNs by masking beforehand. There will be a RuntimeWarning if the array contains NaNs.

Parameters:
array: numpy.ndarray

The value array.

minVal: int | float | None = None

The minimum value to be included in the new array.

maxVal: int | float | None = None

The maximum value to be included in the new array.

leftOpen: bool = False

If False (default), the left interval limit, defined by minVal, is left closed. This means that values greater than or equal minVal are masked valid. If True, the left interval limit is left opened and only values greater than minVal are masked valid.

rightOpen: bool = False

If False (default), the right interval limit, defined by maxVal, is right closed. This means that values less than or equal maxVal are masked valid. If True, the right interval limit is right opened and only values less than maxVal are masked valid.

Returns:

The mask

static GetParameterPanel(parent) → wx.Panel | None

This method can be implemented to create a custom parameterization panel for the trace step dialog. It is designated to edit trace step parameters (no signals). The panel must inherit from wx.Panel or any subclass, and must implement the methods of the interface ‘ParameterPanel’ (no inheritance required). See TraceanalysisAPI documentation section ‘Custom GUI for parameters’ for more information.

Note:

Keep imports of GUI frameworks locally, please.

Returns:

Returns a subclass of wx.Panel that implements the methods defined by the interface of ParameterPanel. The return value can be None if no custom GUI is defined.

Info

Interface method: Can be overridden by child class.

SignalDefinition

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.SignalDefinition

Definition of an incoming or outgoing signal of the trace step.

__init__(name: str, direction: str, optional: bool = False, description: str = '')
Parameters:
name: str

Name of the signal. Must be a valid Python identifier.

direction: str

Direction of the signal: ‘IN’, ‘OUT’.

optional: bool = False

This parameter only applies to signals with direction IN. OUT signals will always be optional. If True, the signal is optional. When using the trace step, it is allowed that the signal is not assigned or not found in the trace or no trace is given.

description: str = ''

Description of the signal.

ParameterDefinition

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.ParameterDefinition

Definition of an input or return parameter of the trace step.

__init__(name: str, direction: str, default: object = None, description: str = '')
Parameters:
name: str

Name of the parameter. Must be a valid Python identifier.

direction: str

Direction of the parameter: ‘IN’, ‘OUT’.

default: object = None

Default value if no parameter value (value None) is specified when used.

description: str = ''

Description of the parameter.

Report

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.Report

This class represents the overall report of the trace step.

Note:

In general, results should be set on TriggerRanges. The overall result will be determined automatically. If you set the result via this class, the result is fixed and will not change even if a TriggerRange has a worse result.

ImageFromBytes(dataBytes: bytes, name: str | None = None, title: str | None = None) → ReportImage
Parameters:
dataBytes: bytes

byte stream (see: https://docs.python.org/3.7/library/io.html and https://docs.python.org/3/library/stdtypes.html#bytes)

name: str | None = None

name of the image (e.g. used as file name in html/json report)

title: str | None = None

the image title

Info

Deprecated: Please use Report.Image() instead.

AddResultColumn(name: str) → None

Adds a new column with the given name to the result table. It is appended at the end of the table. Values can be inserted into this column by using the parameter “additionalInfo” of the methods Spot() and Range(). The entries in the list “additionalInfo” list are inserted into the additional result columns in sequence.

Parameters:
name: str

name of the new column

Image(imageSource: str | Path | Image | numpy.ndarray | bytes, *, name: str | None = None, title: str | None = None, embedded: bool = False, limitPreviewSize: bool = True, autoDelete: bool = False, useTemp: bool = True) → ReportImage

Adds the given image to the test report. If the image is not embedded in the test report, the file will be stored in the report folder. If there is already an image with the same name, the image files will be enumerated.

Parameters:
imageSource: str | Path | Image | numpy.ndarray | bytes

The image source can be one of the following:

  • an absolute file path

  • an Image or Frame object

  • a NumPy array in OpenCV style: shape is (height, width, 3) of type numpy.uint8, the three colors have the order BGR!

  • bytes object with image data

name: str | None = None

The filename (with correct extension). Will be used as filename if an image file is created in the report folder. If name is None and the source is a path or an Image or Frame, the name of the imageSource is used.

title: str | None = None

the image title

embedded: bool = False

True, if the image file should be embedded in the test report, else the image file is stored in the test report folder.

limitPreviewSize: bool = True

If True (default), the preview image shown in the report will be limited to a maximum size.

autoDelete: bool = False

Only applicable if imageSource is a file path. True, if the image file should be automatically deleted, else False.

useTemp: bool = True

Only applicable if imageSource is a file path. True, if the image file should be copied into a temporary directory, False, if it should be used directly. Using a temporary copy might be necessary to avoid overriding the image before the final report gets assembled later on.

Log(level: int, time: float, message: str, *formatArgs, **formatKwargs) → None

Adds a log message to the trace analysis log file. Use SetLogComponent() to set the component part of the log entry.

Parameters:
level: int

log level

  • report.LOG_LEVEL_DEBUG

  • report.LOG_LEVEL_INFO

  • report.LOG_LEVEL_WARNING

  • report.LOG_LEVEL_ERROR

time: float

timestamp of the log message

message: str

log message or format string.

*formatArgs

additional non-keyword arguments used when message is a format string

**formatKwargs

additional keyword arguments used when message is a format string

Note:

The usage of a format string and its arguments is corresponding to str.format (external link).

Example:

report.Log(
    report.LOG_LEVEL_WARNING,
    1.3,
    "Signal exceeds threshold {1:f}! Value {0:.5f}",
    currentValue,
    myThreshold,
)
report.Log(
    report.LOG_LEVEL_ERROR,
    1.3,
    "Signal exceeds threshold {threshold:f}! Value {value:.5f}",
    threshold=myThreshold,
    value=currentValue,
)
LogDebug(time: float, message: str, *formatArgs, **formatKwargs) → None

Convenience method to add a debug log message. See Log() for further usage.

LogError(time: float, message: str, *formatArgs, **formatKwargs) → None

Convenience method to add an error log message. See Log() for further usage.

LogInfo(time: float, message: str, *formatArgs, **formatKwargs) → None

Convenience method to add an info log message. See Log() for further usage.

LogWarning(time: float, message: str, *formatArgs, **formatKwargs) → None

Convenience method to add a warning log message. See Log() for further usage.

SetLogComponent(component: str) → None

Sets the component that will be used in logging entries created by calling log methods.

Parameters:
component: str

name of the component

SetResultError() → None

Convenience method for report.SetResultId(report.RESULT_ID_ERROR)

SetResultFailed() → None

Convenience method for report.SetResultId(report.RESULT_ID_FAILED)

SetResultId(resultId: int | None) → None

Sets the result id for the current trace step.

The result id can be one of:

  • report.RESULT_ID_NONE

  • report.RESULT_ID_SUCCESS

  • report.RESULT_ID_INCONCLUSIVE

  • report.RESULT_ID_FAILED

  • report.RESULT_ID_ERROR

The result id is set directly. It is not affected by earlier calls to SetResultId().

Example:

report.SetResultId(report.RESULT_ID_ERROR)
report.SetResultId(report.RESULT_ID_NONE)

report.GetResultId() # this will result in report.RESULT_ID_NONE
Parameters:
resultId: int | None

the result id to set

SetResultInconclusive() → None

Convenience method for report.SetResultId(report.RESULT_ID_INCONCLUSIVE)

SetResultSuccess() → None

Convenience method for report.SetResultId(report.RESULT_ID_SUCCESS)

SetResultText(text: str | None) → None

Sets a user-defined text for the result of the report.

Parameters:
text: str | None

the text

Table(tableId: str | int | None = None, headerValues: Iterable[str | int] | None = None) → ReportTable

Creates a table in the test report.

Example:

table = report.Table("table1", ["time", "description"])
table.AddRow(["1.3", "A rising edge detected"])
table.AddRow(["3.8", "A falling edge detected"])
Parameters:
tableId: str | int | None = None

id to identify the table

headerValues: Iterable[str | int] | None = None

iterable with the entries of the table header

Returns:

the report table object

UpdateResultId(resultId: int) → None

Updates the result id for the current trace step.

The result id can be one of:

  • report.RESULT_ID_NONE

  • report.RESULT_ID_SUCCESS

  • report.RESULT_ID_INCONCLUSIVE

  • report.RESULT_ID_FAILED

  • report.RESULT_ID_ERROR

In contrast to SetResultId(), which sets the resultId directly, UpdateResultId() can only increase the resultId according to the following ordering:

RESULT_ID_NONE < RESULT_ID_SUCCESS < RESULT_ID_INCONCLUSIVE < RESULT_ID_FAILED < RESULT_ID_ERROR

Info

UpdateResultId() can bee seen as equivalent to SetResultId(max(resultId, GetResultId()))

..example:

report.UpdateResultId(report.RESULT_ID_SUCCESS)
...
report.UpdateResultId(report.RESULT_ID_FAILED)
...
report.UpdateResultId(report.RESULT_ID_SUCCESS)

report.GetResultId() # this will result in report.RESULT_ID_FAILED
Parameters:
resultId: int

the result id to set

TriggerRange

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.TriggerRange

Representation of a trigger range. Contains timestamps and values of signals on the common time axis within the range as well as report information of a trigger range.

ImageFromBytes(dataBytes: bytes, name: str | None = None, title: str | None = None) → ReportImage
Parameters:
dataBytes: bytes

byte stream (see: https://docs.python.org/3.7/library/io.html and https://docs.python.org/3/library/stdtypes.html#bytes)

name: str | None = None

name of the image (e.g. used as file name in html/json report)

title: str | None = None

the image title

Info

Deprecated: Please use TriggerRange.Image() instead.

GetRelativeTimestamps() → numpy.ndarray

Returns the timestamps of the common time axis within the trigger range relative to the start trigger time.

GetResultId() → int

Gets the current result id.

The result id passed to an earlier call to SetResultId() is returned. If SetResultId() wasn’t called before, RESULT_ID_NONE is returned.

Returns:

the result id

GetSlice() → slice

Returns a slice [from, to] that can be used to slice from arrays that are based on the main time axis.

GetStartTime() → float

Returns the start time of the trigger range.

Note:

The value can be different to the first sample of the common time axis or any signal time axis for the following cases:

  • used in a trigger block that uses different signals

  • not in a trigger block: The first sample of all signals of the episode will be taken.

Returns:

The start time or None if it could not be determined (e.g. no signal with samples)

GetStartValue(sigName: str, deltaT: float = 0.0) → Any

Returns the value of the given signal at the timestamp of the start trigger plus deltaT.

Parameters:
sigName: str

The regarded signal

deltaT: float = 0.0

Offset to the start trigger timestamp.

GetStopTime() → float

Returns the timestamp where the trigger range ends.

Note:

This can be different to the last sample of the common time axis or any signal time axis for the following cases:

  • used in a trigger block that uses different signals

  • not in a trigger block: The first sample of all signals of the episode will be taken.

Note:

There is no evaluation at the stop time. Exception: stop at end of trace.

Returns:

The stop time or None if it could not be determined (e.g. no signal with samples)

GetStopValue(sigName: str, deltaT: float = 0.0) → Any

Returns the value of the given signal at the timestamp of the stop trigger plus deltaT.

Parameters:
sigName: str

The regarded signal

deltaT: float = 0.0

Offset to the stop trigger timestamp.

GetTimestamps() → numpy.ndarray

Returns the timestamps of the common time axis within the trigger range.

GetValues(sigName: str) → numpy.ndarray

Returns the values of a signal on the common time axis within the trigger range.

Image(imageSource: str | Path | Image | numpy.ndarray | bytes, *, name: str | None = None, title: str | None = None, embedded: bool = False, limitPreviewSize: bool = True, autoDelete: bool = False, useTemp: bool = True) → ReportImage

Adds the given image to the test report. If the image is not embedded in the test report, the file will be stored in the report folder. If there is already an image with the same name, the image files will be enumerated.

Parameters:
imageSource: str | Path | Image | numpy.ndarray | bytes

The image source can be one of the following:

  • an absolute file path

  • an Image or Frame object

  • a NumPy array in OpenCV style: shape is (height, width, 3) of type numpy.uint8, the three colors have the order BGR!

  • bytes object with image data

name: str | None = None

The filename (with correct extension). Will be used as filename if an image file is created in the report folder. If name is None and the source is a path or an Image or Frame, the name of the imageSource is used.

title: str | None = None

the image title

embedded: bool = False

True, if the image file should be embedded in the test report, else the image file is stored in the test report folder.

limitPreviewSize: bool = True

If True (default), the preview image shown in the report will be limited to a maximum size.

autoDelete: bool = False

Only applicable if imageSource is a file path. True, if the image file should be automatically deleted, else False.

useTemp: bool = True

Only applicable if imageSource is a file path. True, if the image file should be copied into a temporary directory, False, if it should be used directly. Using a temporary copy might be necessary to avoid overriding the image before the final report gets assembled later on.

IsWholeTrace() → bool

Returns True if the trace step has no trigger block as ancestor. In this case there will only be one trigger range that represents the entire time domain of the trace analysis.

Correspondingly, if the trace step is contained in a trigger block, this method will return False for all trigger ranges.

Range(startTime: float, stopTime: float, message: str = '', resultId: int = 0, additionalInfo: list[str] | None = None) → None

Adds a sub range to the trigger range.

Parameters:
startTime: float

timestamp at which the sub range begins

stopTime: float

timestamp at which the sub range ends

message: str = ''

a textual message describing the sub range

resultId: int = 0

the verdict for the sub range

additionalInfo: list[str] | None = None

a list of additional information, that will be shown in the custom result columns (see Report.AddResultColumn())

SetResultError() → None

Convenience method for triggerRange.SetResultId(triggerRange.RESULT_ID_ERROR)

SetResultFailed() → None

Convenience method for triggerRange.SetResultId(triggerRange.RESULT_ID_FAILED)

SetResultId(resultId: int) → None

Sets the result id for the trigger range.

The result id can be one of:

  • triggerRange.RESULT_ID_NONE

  • triggerRange.RESULT_ID_SUCCESS

  • triggerRange.RESULT_ID_INCONCLUSIVE

  • triggerRange.RESULT_ID_FAILED

  • triggerRange.RESULT_ID_ERROR

The result id is set directly. It is not affected by earlier calls to SetResultId().

Example:

triggerRange.SetResultId(triggerRange.RESULT_ID_ERROR)
triggerRange.SetResultId(triggerRange.RESULT_ID_NONE)

triggerRange.GetResultId() # this will result in triggerRange.RESULT_ID_NONE
Parameters:
resultId: int

the result id to set

SetResultInconclusive() → None

Convenience method for triggerRange.SetResultId(triggerRange.RESULT_ID_INCONCLUSIVE)

SetResultNone() → None

Convenience method for triggerRange.SetResultId(triggerRange.RESULT_ID_NONE)

SetResultSuccess() → None

Convenience method for triggerRange.SetResultId(triggerRange.RESULT_ID_SUCCESS)

SetResultText(resultText: str | None) → None

Sets a user-defined result text of the trigger range.

Parameters:
resultText: str | None

the text

Spot(time: float, message: str = '', resultId: int = 0, additionalInfo: list[str] | None = None) → None

Adds a signal spot to the trigger range.

Parameters:
time: float

timestamp of the spot

message: str = ''

a textual message describing the spot

resultId: int = 0

the verdict for the spot

additionalInfo: list[str] | None = None

a list of additional information, that will be shown in the custom result columns (Report.AddResultColumn)

Table(tableId: str | int | None = None, headerValues: Iterable[str | int] | None = None) → ReportTable

Creates a table in the test report.

Example:

table = report.Table("table1", ["time", "description"])
table.AddRow(["1.3", "A rising edge detected"])
table.AddRow(["3.8", "A falling edge detected"])
Parameters:
tableId: str | int | None = None

id to identify the table

headerValues: Iterable[str | int] | None = None

iterable with the entries of the table header

Returns:

the report table object

UpdateResultId(resultId: int) → None

Updates the result id for the trigger range.

The result id can be one of:

  • triggerRange.RESULT_ID_NONE

  • triggerRange.RESULT_ID_SUCCESS

  • triggerRange.RESULT_ID_INCONCLUSIVE

  • triggerRange.RESULT_ID_FAILED

  • triggerRange.RESULT_ID_ERROR

In contrast to SetResultId(), which sets the resultId directly, UpdateResultId() can only increase the resultId according to the following ordering:

RESULT_ID_NONE < RESULT_ID_SUCCESS < RESULT_ID_INCONCLUSIVE < RESULT_ID_FAILED < RESULT_ID_ERROR

Info

UpdateResultId() can bee seen as equivalent to SetResultId(max(resultId, GetResultId()))

Example

triggerRange.UpdateResultId(triggerRange.RESULT_ID_SUCCESS) … triggerRange.UpdateResultId(triggerRange.RESULT_ID_FAILED) … triggerRange.UpdateResultId(triggerRange.RESULT_ID_SUCCESS)

triggerRange.GetResultId() # this will result in triggerRange.RESULT_ID_FAILED

Parameters:
resultId: int

the result id to set

Signal

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.Signal

A signal provides access to meta information, such as the physical unit. You can also access the specific time axis of the signal and the corresponding signal values. For outgoing signals the method Emit() can be called to set timestamps and values.

Emit(timestamps: numpy.ndarray, values: numpy.ndarray) → None

Sets timestamps and values of an outgoing (calculated signal).

Parameters:
timestamps: numpy.ndarray

Time axis of the signal.

values: numpy.ndarray

Values of the signal.

Raises:

ValueError – Called on an incoming signal or with arrays of different length.

GetGenericName() → str

Returns the name of the generic signal this signal is bound to. If the signal is not bound, it will return an empty string.

GetInterpolatedValues() → numpy.ndarray | None

Returns the values interpolated on the common time axis of the trace step.

Returns:

The interpolated values. Will return None for outgoing signals!

GetMappingItemName() → str

Returns the name of the mapping item this signal relates to. If the signal is not bound or it is bound to a calculated signal, it will return an empty string.

GetRecordingInfo() → RecordingInfo | None

Returns the RecordingInfo of the assigned generic signal.

If the returned value is not None, the documented methods on the returned RecordingInfo object can be called to obtain further information.

Returns:

RecordingInfo if the source of the assigned generic signal is a recording else None

GetTextTable() → tuple[Mapping[int, str] | None, str | None]

Returns the text table and the default value of the signal as tuple.

GetTimestamps(fromTo: tuple[float | None, float | None] | None = None, *, leftOpen: bool = False, rightOpen: bool = True) → numpy.ndarray

Returns the time axis of the signal. The parameter fromTo can be used to only timestamps in a given time range.

Parameters:
fromTo: tuple[float | None, float | None] | None = None

An optional tuple with timestamps (from, to) to get only the timestamps in a given time range. By default, the time range is handled as right open interval. Use the parameters leftOpen and rightOpen to change this behavior. It is possible to set one of the limits to None to restrict the time axis only in one direction.

leftOpen: bool = False

Only valid if fromTo is given. Sets whether fromTo will be handled as left open interval (default False).

rightOpen: bool = True

Only valid if fromTo is given. Sets whether fromTo will be handled as right open interval (default True).

Note:

The parameters leftOpen and rightOpen are keyword only arguments!

GetTraceFileSignalName() → str

Returns the name of the signal in the trace file the signals comes from. Will be an empty string if the signal is not bound / not present.

GetUnit() → str

Returns the unit of the signal.

GetValueAt(timestamp: float) → float | None

Returns the signal value at a given timestamp.

Note:

This method is not intended to be used in an iterative manner. To get multiple interpolated values use the static method AbstractNumpyBasedTraceStep.FitToAxis().

Returns:

The signal value. Values will be interpolated by sample-and-hold. Returns None if the signal has no sample until timestamp.

GetValues(fromTo: tuple[float | None, float | None] | None = None, *, leftOpen: bool = False, rightOpen: bool = True) → numpy.ndarray

Returns the values of the signal. The parameter fromTo can be used to only values in a given time range.

Parameters:
fromTo: tuple[float | None, float | None] | None = None

An optional tuple with timestamps (from, to) to get only the values in a given time range. By default, the time range is handled as right open interval. Use the parameters leftOpen and rightOpen to change this behavior. It is possible to set one of the limits to None to restrict the time axis only in one direction.

leftOpen: bool = False

Only valid if fromTo is given. Sets whether fromTo will be handled as left open interval (default False).

rightOpen: bool = True

Only valid if fromTo is given. Sets whether fromTo will be handled as right open interval (default True).

Note:

The parameters leftOpen and rightOpen are keyword only arguments!

IsBound() → bool

Returns if the trace step signal is bound to a generic signal of the trace analysis.

IsFound() → bool

Returns if the signal is found (is bound, and is calculated or is found in the existing trace file).

IsOutSignal() → bool

Returns if the signal is an output signal.

RecordingInfo

class tts.interface.recording.RecordingInfo.RecordingInfo
abstractmethod GetFirstPath() → str | None

Returns the first path of the path list of the recordings or None, if the list is empty.

Returns:

The path.

abstractmethod GetPath(idx: int = 0) → str | None

Returns the path at the specified index of the path list of the recordings or None, if the index is out of range or the list is empty.

Parameters:
idx: int = 0

The index of the path to retrieve.

Returns:

The path at the specified index or None if the index is out of range or the list is empty.

abstractmethod GetPathList() → list[str]

Returns the list of paths to the recordings.

Returns:

The list of paths.

abstractmethod GetRecordingName() → str | None

Returns the name of the recording or None, if the name is not set.

: returns: The name of the recording or None.

abstractmethod GetRecordingNumber() → int

Returns the number of the recording within the associated recording group.

Returns:

The number of the recording.

abstractmethod GetRecordingType() → str

Returns the type of the recording.

Returns:

The type of the recording.

abstractmethod GetStartTimeNs() → int | None

Returns the start time of the recording in nanoseconds since 1970-01-01T00:00:00Z.

Returns:

Start time in nanoseconds or None if the recording format does not support it.

ReportTable

class tts.interface.traceAnalysis.steps.NumpyBasedTraceStep.ReportTable

A ReportTable object represents a table in the test report.

AddRow(values: Iterable[str | int], resultId: int | None = None) → None

Appends a row to the table.

Parameters:
values: Iterable[str | int]

iterable with the entries for each column of the new row

resultId: int | None = None

the result id of the row

SetHeader(values: Iterable[str | int] | None) → None

Sets the table header.

Parameters:
values: Iterable[str | int] | None

iterable with the entries for each column of the table header