Array-based NumPy trace step templates

NumpyBasedTraceStep

class traceAnalysisAPI.arraybased.NumpyBasedTraceStep
abstractmethod static GetInterfaceRevision()

Returns the interface revision of the trace step template.

Note:

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

Return type:

int

Info

Interface method: Has to be overridden by child class.

classmethod GetDescription()

Returns the description of the trace step.

Return type:

str

Info

Interface method: Can be overridden by child class.

abstractmethod classmethod GetSignals()

Returns the incoming and outgoing signals of the trace step.

Return type:

list[SignalDefinition]

Info

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

to use signals in trace step template.

classmethod GetParameters()

Returns the input and return parameters of the trace step.

Return type:

list[ParameterDefinition]

Info

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

to use parameters in trace step template.

classmethod GetTimeAxisDefinition()

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.

Return type:

str

Info

Interface method: Can be overridden by child class.

Check(parameters)

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, object]

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, report, timeAxis, ranges, signals)

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, object]

Dictionary of parameter values.

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

Dictionary of signals.

Info

Interface method: Has to be overridden by child class.

static FitToAxis(timestamps, values, targetTimeArray, leftFillValue=None, rightFillValue=None)

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

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

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.

Return type:

numpy.ndarray

static CalculateRanges(boolArray)

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.

Return type:

list[tuple[int, int, bool]]

static CalculateMaskForRange(array, minVal=None, maxVal=None, leftOpen=False, rightOpen=False)

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

The minimum value to be included in the new array.

maxVal : int|float

The maximum value to be included in the new array.

leftOpen : bool

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

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

Return type:

numpy.ndarray

static GetParameterPanel(parent)

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.

Return type:

wx.Panel

Info

Interface method: Can be overridden by child class.

SignalDefinition

class traceAnalysisAPI.arraybased.SignalDefinition

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

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

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

direction : str

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

optional : bool

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 traceAnalysisAPI.arraybased.ParameterDefinition

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

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

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

direction : str

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

default : object

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

description : str

Description of the parameter.

Report

class traceAnalysisAPI.arraybased.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, name=None, title=None)
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

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

title : str

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

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, dataContainer.RESULT_ID_NONE is returned.

Returns:

the result id

Return type:

int

Image(imageSource: str | Path | ImageInterface | 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|Frame|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

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

the image title

embedded : bool

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

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

autoDelete : bool

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

useTemp : bool

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, time, message, *formatArgs, **formatKwargs)

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, message, *formatArgs, **formatKwargs)

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

LogError(time, message, *formatArgs, **formatKwargs)

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

LogInfo(time, message, *formatArgs, **formatKwargs)

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

LogWarning(time, message, *formatArgs, **formatKwargs)

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

SetLogComponent(component)

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

Parameters:
component : str

name of the component

SetResultError()

Convenience method for report.SetResultId(report.RESULT_ID_ERROR)

SetResultFailed()

Convenience method for report.SetResultId(report.RESULT_ID_FAILED)

SetResultId(resultId)

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 : result id

the result id to set

SetResultInconclusive()

Convenience method for report.SetResultId(report.RESULT_ID_INCONCLUSIVE)

SetResultSuccess()

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

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

id to identify the table

headerValues : iterable

iterable with the entries of the table header

Returns:

the report table object

Return type:

ReportTable

UpdateResultId(resultId)

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 : result id

the result id to set

TriggerRange

class traceAnalysisAPI.arraybased.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() → 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() → ndarray

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

GetValues(sigName: str) → ndarray

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

Image(imageSource: str | Path | ImageInterface | 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|Frame|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

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

the image title

embedded : bool

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

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

autoDelete : bool

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

useTemp : bool

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

id to identify the table

headerValues : iterable

iterable with the entries of the table header

Returns:

the report table object

Return type:

ReportTable

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 traceAnalysisAPI.arraybased.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: ndarray, values: ndarray) → None

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

Parameters:
timestamps: ndarray

Time axis of the signal.

values: 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() → 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

GetTimestamps(fromTo: tuple[float | None, float | None] | None = None, *, leftOpen: bool = False, rightOpen: bool = True) → 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 NumpyBasedTraceStep.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) → 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 traceAnalysisAPI.arraybased.RecordingInfo

A RecordingInfo object contains information about the name, number, type and path of the underlying recording from which the signal stems.

GetFirstPath() → str | None

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

Returns:

path of the first recording, if exists

GetPath(idx=0) → str | None

Returns the path (or the first path if there is a list of paths) for the recording.

Returns:

The path

GetPathList() → list[str]

Returns the path list of the recordings.

Returns:

path list of the recordings

GetRecordingName() → str | None

Returns the name of the recording.

Returns:

the name of the recording

GetRecordingNumber() → int

Returns the number of the recording.

Returns:

the number of the recording (>=0, and < the total number of the associated recording group)

GetRecordingType() → str

Returns the type of the recording.

Returns:

type of the recording

GetStartTimeNs(*, synchronized: bool = True) → int | None

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

This information is useful to calculate absolute timestamps, e.g.:

absoluteTimestampsInNs = int(relativeTimestampsInSeconds * 1e9) + startTimeNs

If the traces have not been synchronized, the value of the parameter synchronized does not matter. If the traces have been sychronized, this method should normally be called with synchronized=True (default) so that the start time is adjusted to the deltaT and the adjusted start time can just be added to the synchronized timestamps to get the absolute timestamps. However, if you want to get the real start time without any adjustments, you should call this method with synchronized=False.

Parameters:
synchronized: bool = True

If True, the start time is adjusted by the deltaT if available.

Returns:

start time in nanoseconds or None if not available

ReportTable

class traceAnalysisAPI.arraybased.ReportTable

A ReportTable object represents a table in the test report.

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

Appends a row to the table.

Parameters:
values : iterable

iterable with the entries for each column of the new row

resultId : result id or None

the result id of the row

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

Sets the table header.

Parameters:
values : iterable

iterable with the entries for each column of the table header