TyphoonTest Library documentation

What is the difference between TyphoonTest API and other Typhoon APIs?

TyphoonTest API is meant to be easier to use and abstract away from HIL-specific details, meaning clearer tests that convey more effectively the intent and that could be used, in the future, for other targets than HIL simulation.

TyphoonTest API can be used together with other Typhoon APIs in the same test code without problems. We recommend to use TyphoonTest API functions when possible, and then use other Typhoon APIs if needed. For other APIs, please refer to the Typhoon APIs’ documentation locally or online.

How can I sequence and run my tests with TyphoonTest Framework?

TyphoonTest Framework uses the popular pytest python tool for running tests. It is fully supported in our TyphoonTest IDE and can also be used directly from the command line. For more information, check our TyphoonTest IDE documentation and also check pytest documentation. Typhoontest defines some new command line arguments which can be specified during pytest invocation. They are explained here Pytest command-line arguments added by TyphoonTest.

typhoon.test.capture Package

This package contains higher-level, simpler versions of functions already released HIL API.



Return capture results as a Pandas DataFrame.

merge_dataframes(left, right[, ...])

Merge two DataFrame objects with a database-style join.

read(name[, avg_reads])

Reads asynchronously a signal once (one time poll).


Reads cff file exported from typhoon capture.


Reads csv file exported from typhoon capture.


Reads hdf file exported from typhoon capture.


Reads mat file exported from typhoon capture.


Reads mdf file exported from typhoon capture.


Reads tdms file exported from typhoon capture.

start_capture(duration[, offset_absolute, ...])

Sets up capture settings and start capture.


Waits a defined amount of seconds.


Blocks until capture stops.

wait_until(name, region, value[, ...])

Waits until signal meets specified conditions.

typhoon.test.sources Package

This package contains high-level functions for dealing with power sources.


change_grid(gridname[, rms, frequency, phase])

Change grid characteristics.


Reads a Phasor3ph out of the chosen GridSimulator.


Get maximum power point information from a PV panel.

grid_fault(sources, fault_duration[, ...])

Generic function for creating grid faults.

typhoon.test.signals Package

This package contains high-level functions to analyze desired characteristics from time series signals.


assert_analysis(result, expectation)

Assertion helper for AnalysisResult objects, printing the result message in the AssertionError if raised.

assert_follows_reference(signal, ref_signal, tol)

Assertion helper for follows_reference function.

assert_is_constant(signal, at_value[, ...])

Assertion helper for is_constant function.

assert_is_first_order(signal, time_constant, ...)

Assertion helper for is_first_order function.

assert_is_ramp(signal, slope, tol[, during, ...])

Assertion helper for is_ramp function.

assert_is_step(signal, from_value, to_value, ...)

Assertion helper for is_step function.

find(signal, region, value[, from_region, ...])

Like the function typhoon.test.signals.find_all, it finds the desired characteristic on the signal.

find_all(signal, region, value[, ...])

Finds a desired characteristic on a signal.

find_edges(signal, value[, rising, falling, ...])

Find edges around a given value in a signal.

follows_reference(signal, ref_signal, tol[, ...])

Checks if signal follows a reference signal within given tolerances.

is_constant(signal, at_value[, during, ...])

Checks if signal is always inside defined range.

is_first_order(signal, time_constant, ...[, ...])

Checks if signal represents first order response.

is_ramp(signal, slope, tol[, during, ...])

Checks if signal is a ramp with desired slope.

is_step(signal, from_value, to_value, at_t)

Checks if signal is a step with specified characteristics.

pandas_3ph_sine([amplitude, frequency, ...])

Generates a pandas DataFrame with a set of three balanced sine waves with given characteristics.

pandas_first_order(tau, init, final[, ...])

Generates pandas Series as the first order response signal with given characteristics.

pandas_sine([amplitude, frequency, ...])

Generates a pandas Series with a sine wave with given characteristics.

stepinfo(signal[, settling_time_threshold, ...])

Calculates important step characteristics of a given signal: rise time, settling time, overshoot, and others.

typhoon.test.signals.filtering Package

This package contains function relevant to signal filtering


band_pass_filter(input_signal, N, Wn[, ...])

Wrapper around 'scipy.signal <https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html>' function that represents Butterworth digital and analog filter design.

band_stop_filter(input_signal, N, Wn[, ...])

Wrapper around 'scipy.signal <https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html>' function that represents Butterworth digital and analog filter design.

high_pass_filter(input_signal, N, Wn[, ...])

Wrapper around 'scipy.signal <https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html>' function that represents Butterworth digital and analog filter design.

low_pass_filter(input_signal, N, Wn[, ...])

Wrapper around 'scipy.signal <https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html>' function that represents Butterworth digital and analog filter design.

moving_average(signal, window_length[, ...])

Calculates average value of the provided signal by using moving window technique, similar to 'typhoon.test.rms.window_rms' function.

typhoon.test.signals.control Package

This module contains basic control blocks implementations


integrator(input, initial_value[, ...])

Integrates provided input signal.

signal_frequency_SOGI_pll(input, ...[, ...])

Measures the frequency of the signal using a SOGI PLL algorithm.

typhoon.test.ranges Module

This module contains useful shorthand functions for defining ranges (value and temporal), to better comunicate intent when writing test functions. Is to be typically used in the arguments of timeseries analysis functions (is_step, etc).

Check each function for usage examples.



Defines a time range from t to latest possible value.

around(val[, tol, tol_p])

Defines range as a center value with a tolerance around it.


Defines time range from earliest possible up to t.

typhoon.test.harmonic Package

This package contains functions for frequency-domain operations and transformations.


frequency_content(signal, max_frequency[, ...])

Calculates the list of harmonic components for a signal using FFT.

signal_frequency_zc(signal[, during, mode])

Calculates frequency of the signal.

thd(signal, fundamental, max_harmonic[, ...])

Calculates signal THD


FFTResult(signal, fft, freqs)

Result of frequency_content analysis.

typhoon.test.IEC61000 Package

This package contains measurement functions according to the IEC 61000 standard.


flickermeter(samples, reference_voltage, ...)

This is a digital flickermeter based on 61000-4-30 standard.


This method calculates the frequency of the grid voltage.

harmonic_content(samples, nominal_grid_freq, ...)

This method measures harmonics, interharmonics, and total harmonic distortion according to IEC 61000-4-7.

power_quantities(voltage_samples, ...[, ...])

This method measures power quantities in single-phase systems under non-sinusoidal conditions (general case) according to IEC 61000-1-7.

power_quantities_three_phase(...[, ...])

This method measures power quantities in Three-phase systems under non-sinusoidal conditions (general case) according to IEEE Std 1459-2010.

rms(samples, nominal_grid_freq[, ...])

Measures the root-mean-square (RMS) value for input samples according to the IEC 61000-4-30 standard.

sym_comp_voltage_unbalance(samples, ...[, ...])

Measures the Symmetrical components and Voltage Unbalance according to IEEE Std 1159-2019.

typhoon.test.rms Package


window_rms(signal[, window_length, ...])

Calculates RMS value of the signal using sliding window technique.

typhoon.test.power Package

This package is used for different electric power calculations.


three_phase_power(voltages, currents[, ...])

Calculates three phase power for three-phase systems with both three and four wires.

typhoon.test.transformations Package


abc_to_alphabetagamma(signals[, method, ...])

Calculates abc to alpha-beta-gamma trasformation, also known as Clarke's transformation.

abc_to_dq0(signals, theta[, method, alignment])

Implements abc_to_dq0 transformation, also known as Park trasformation.

abc_to_symmetrical_components(signals[, method])

Implements the Symmetrical transformation, also known as Fortescue transform.

alphabetagamma_to_abc(signals[, method, ...])

Calculates alpha-beta-gamma to abc transformation, also known as Clarke's inverse transformation.

alphabetagamma_to_dq0(signals, theta[, ...])

Implements the alpha-beta-gamma to dq0 transformation, also known as Clarke to Park angle transform.

complete_symmetrical_components(V0, V1, V2)

Calculates three three-phase "abc" sets from symmetrical components.

dq0_to_abc(signals, theta[, method, alignment])

Implements the dq0_to_abc transformation, also known as inverse Park transformation.

dq0_to_alphabetagamma(signals, theta[, ...])

Implements dq0 to alpha-beta-gamma angle transform, also known as Park to Clarke angle transform.

inv_symmetrical_components(V0, V1, V2)

Calculates the a, b and c phasors from symmetrical components.

symmetrical_components(Va, Vb, Vc)

Calculates symmetrical values abc phasors.

symmetrical_components_to_abc(signals[, method])

Implements the Inverse Symmetrical Transformation to abc coordinates.

typhoon.types.phasors Module


Phasor([number, mag, angle])

Class implement Phasors, which subclass complex numbers but adds:

Phasors3ph(phasor1, phasor2, phasor3[, ...])

Creates a Phasors3ph tuple.

typhoon.test.reporting.tables Package

This package contains functions used for attaching different types of html tables to allure report.


attach_table(df[, allure_title, caption, ...])

Adds HTML table with a simple CSS configuration to allure report. This type of table can be used to show:

attach_table_custom_colormap(df, threshold)

Adds HTML table with a specific colormap applied in the table's background to the allure report.

attach_table_custom_colormap_by_column(df, ...)

Adds html table to allure report in the same way as the attach_table_custom_colormap with only difference that the threshold value is unique for each column; the user can repeat the threshold values, but threshold value is needed for every column.

text_style(paragraph[, bold, italic, color])

Set a string to be a paragraph with specifics HTML tags.

typhoon.test.reporting.messages Package

This python package deals with logging of report messages to report, and with report organization in general.



Logs message to the allure report.


Adds message in allure report, like typhoon.test.reporting.messages.report_message function, but, in contrast to it, this function should be used to organize more functions and report messages in one logical group.

typhoon.test.reporting.figures Package

This packages contains functions for attachment of matplotlib figures to allure reports


attach_figure(dataframe_list, attachment_name)

Adds matplotlib figure of provided signals in the allure report as .png image attachment.

typhoon.types.timedelta Module


Timedelta(*args, **kwargs)

Represents a duration, the difference between two dates or times.

Pytest command-line arguments added by TyphoonTest

TyphoonTest plugin for pytest provides several command-line arguments for test run:

Pytest and allure report operations

  1. --alluredir=DIR - Generate an Allure report in the specified directory DIR (may not exist).

  2. --clean-alluredir - Clean alluredir folder, if it exists.

  3. --open-allure - Automatically opens allure-report after test run, if specified;

  4. --remove-capture-plots - Remove allure plot attachments from typhoon.test.capture.get_capture_results function. This is good way to reduce the Allure report size

  5. --analysis-plot-type - Select which plot to add to the allure report for typhoontest analysis functions for whole test run. Supported functions:

  1. typhoon.test.signals.is_step,

  2. typhoon.test.signals.is_constant,

  3. typhoon.test.signals.is_ramp,

  4. typhoon.test.signals.is_first_order,

  5. typhoon.test.signals.follows_reference

  • There are 4 possible options:

    1. none - no plot will be attached

    2. static - matplotlib plot saved as .png image will be attached. This option saves on file size, but there is no option for any kind of interaction with the image

    3. interactive - plot saved as html file with options to interact with signals on the plot. Much more suitable for debugging failing tests

    4. all - all of the supported plots are attached

  • The specified option applies for the whole test run, but can be overridden individually for each function call using the report_plot dictionary and its key type.

  1. --analysis-plot-on-fail-only - Specifies if report plot of type specified with previous argument is plotted always or on fail only. If specified, plot is attached only when test fails. The specified option applies for whole test run, but it can be overridden individually for every function call: report_plot dictionary and its key when is used for that.

  2. -k EXPRESSION - Only run tests which match the given substring EXPRESSION. Example: -k ‘test_method or test_other’ matches all test functions and classes whose name contains ‘test_method’ or ‘test_other’, while -k ‘not test_method’ matches only those that don’t contain ‘test_method’ in their names. The matching is not case-sensitive.

  3. --markers - Show markers (builtin, plugin, and per-project).

  4. -m MARKEXPR - Only run tests matching given mark expression MARKEXPR. For example: -m ‘mark1 and not mark2’.

  5. --collect-only, --co - Only collect tests, don’t execute them.

  6. --keep-history - Keeps result history from previous test sessions and adds a results history graph to the Allure report

  7. --env-params - Represents path of JSON file where additional environment parameters are located. File is loaded before the execution of the first test.

  8. --disable-auto-steps - Disable the automatic Allure Steps used by all Typhoon APIs, except plots (See --remove-capture-plots and --analysis-plot-type).

  9. enable_assertion_pass_hook=true - Enables the pytest_assertion_pass hook. Make sure to delete any previously generated pyc cache files. Only for initialization file, pytest.ini.

Command Line Real-Time logging

  1. log_cli=true - Enable log display during test run (also known as “live logging”). Only for initialization file, pytest.ini.

  2. --log-cli-level - CLI logging level. During the test procedure logs from different severity levels can be written. Usually set like --log-cli-level=INFO. Other severity levels:

  • DEBUG (lower)

  • INFO



  • CRITICAL (higher)

PDF reporting (beta features)

  1. --generate-pdf - If specified, pdf containing results of test session extracted from Allure report is generated at the end of test session.

  2. --pdf-path - Presents custom path of generated pdf report. If not specified, the pdf report is generated inside working directory with name {timestamp}_report.pdf.

  3. --pdf-title - Defines custom title on the cover page in the pdf report. If not specified, default title name is Typhoon HIL Test session report.

  4. --pdf-title-color - Defines custom title color on the cover page in the pdf report. If not specified, default title color is dark gray (hex value: #333333).

  5. --pdf-logo - Presents path of image that will be presented as custom logo on the cover page in the pdf report. If not specified, default logo on the cover page is Typhoon HIL logo.

  6. --pdf-slogan - Presents custom slogan that will be presented next to the logo on the cover page in pdf report. If not specified, default slogan Test. Design. Deploy. is shown on the cover page.

  7. --pdf-skip-trace - If specified, error traces of tests that failed or broke are omitted from the pdf report.

  8. --pdf-skip-steps - If specified, steps for each test case are omitted from the pdf report.

  9. --pdf-skip-plots - If specified, images containing plots are omitted from the pdf report.

Notice: Attaching HTML tables to PDF report requires Chrome/Chromium browser to be installed on device that is running test session. Otherwise, HTML tables are ignored.

HIL devices selection

  1. --vdev - Allows running tests on VHIL. Both --vdev and --vcfg need to be specified. e.g. --vdev=HIL402 --vcfg=1.

  2. --vcfg - Defines VHIL configuration. Both --vdev and --vcfg need to be specified. e.g. --vdev=HIL402 --vcfg=1.

  3. --ethdev - Allows defining the serial number of HILs that are used for testing on a given network. e.g. --ethdev="00604-00-00170, 00604-00-00171".

  4. --discovery-ip - Allows defining the IP addresses of HILs on a network. e.g. --discovery-ip="192.168.0.xxx, 192.168.0.xxx".

  5. --fw - Allows defining the HIL firmware configuration number (CFG_NUMBER). e.g. --fw=CFG_NUMBER.

CSV Report Real-Time

  1. --simple-report - Generates a simplified report as a csv file. Supported values are: all, setup, call, teardown, None. e.g. --simple-report=all.

Miscellaneous options

  1. --gc-collect - Garbage collector is automatically called after each executed test.

Release Notes

Check the Release Notes of TyphoonTest API here: Release Notes

Indices and tables