Skip to main content
Version: 12.7.0

viktor.external.grlweap

GRLWeapAnalysis

class viktor.external.grlweap.GRLWeapAnalysis(input_file)

Bases: viktor.external.external_program.ExternalProgram

GRLWeapAnalysis can be used to perform an analysis using GRLWeap on a third-party worker. To start an analysis call the method execute(), with an appropriate timeout (in seconds). To retrieve the results call the method get_output_file(), after execute().

Note: the input for the BytesIO object should be of type bytes. You can convert a string to bytes by calling the method encode(). Default encoding is ‘utf-8’.

Usage:

gwt_file = BytesIO("body of gwt input file".encode('utf-8'))
grlweap_analysis = GRLWeapAnalysis(input_file=gwt_file)
grlweap_analysis.execute(timeout=10)
result = grlweap_analysis.get_output_file()

Exceptions which can be raised during calculation: - viktor.errors.ExecutionError: generic error. Error message provides more information

Parameters

input_file (BytesIO) – BytesIO object with the body of the .gwt input file.

get_output_file()

Method can be used to retrieve the results generated by running an external analysis. Call method execute() first and get_output_file() afterwards.

Return type

Optional[BytesIO]