Skip to main content


VIKTOR's GRLWEAP integration requires a specific GRLWEAP worker which can be downloaded here.

Analyzing a GRLWEAP model in VIKTOR can be done using the GRLWeapAnalysis class (worker required). No binding is provided by VIKTOR for this module, which means that the input file has to be generated manually:

from viktor.external.grlweap import GRLWeapAnalysis

# Generate the input GWT file.
input_file = ...

# Run the analysis and obtain the output file.
analysis = GRLWeapAnalysis(input_file)
output_file = analysis.get_output_file()


New in v13.5.0

mock_GRLWeapAnalysis decorator for easier testing of GRLWeapAnalysis

GRLWeapAnalysis.execute needs to be mocked within the context of (automated) testing.

The viktor.testing module provides the mock_GRLWeapAnalysis decorator that facilitate mocking of workers:

import unittest

from viktor import File
from viktor.testing import mock_GRLWeapAnalysis

from app.my_entity_type.controller import MyEntityTypeController

class TestMyEntityTypeController(unittest.TestCase):

def test_grlweap_analysis(self):

For the decorator's input parameters the following holds:

  • If a Sequence type is provided, the next entry is returned for each corresponding method call. When a call is performed on a depleted iterable, an Exception is raised.
  • If a single object is provided, the object is returned each time the corresponding method is called (endlessly).
  • If None is provided (default), a default File/BytesIO object (with empty content) is returned each time the corresponding method is called (endlessly).