VTKPythonAlgorithmBase with two outputs ports and time dependent data


I have a user with a python plugin (VTKPythonAlgorithmBase as the base class) with two outputs :
class OnlineRomReader(VTKPythonAlgorithmBase):
def init(self):
VTKPythonAlgorithmBase.init(self, nInputPorts=0, nOutputPorts=2, outputType=“vtkUnstructuredGrid”)

We use the nOutputPorts to set the numbers of ports.

Almost everything works well. The only problem is that Paraview does not update the visualisation for the second output as time runs. Looks like I’m missing something in the code. I tried to set the DATA_TIME_STEP on the second port data:

outputPortII.GetInformation().Set(outputPortII.DATA_TIME_STEP(), time)

but this has no effect on the ParaView GUI.

Any ideas?

Using Paraview 5.9.1 on linux (home made compilation)

this is the time related part on the plugin

@smproxy.reader(name="OnlineRomReader", label="Online Rom Reader With Parameters", extensions="json", file_description= "Online Rom With Parameters")
class OnlineRomReader(VTKPythonAlgorithmBase):
    def __init__(self):
        VTKPythonAlgorithmBase.__init__(self, nInputPorts=0, nOutputPorts=2, outputType="vtkUnstructuredGrid")

    def RequestInformation(self, request, inInfoVec, outInfoVec):
        executive = self.GetExecutive()
        outInfo = outInfoVec.GetInformationObject(0)
        filep = open(self._filename,"r")
        import json
        self.metaData = json.load(filep)
        timesteps = self.GetTimestepValues()
        if timesteps is not None:
            for t in timesteps:
                outInfo.Append(executive.TIME_STEPS(), t)
            outInfo.Append(executive.TIME_RANGE(), timesteps[0])
            outInfo.Append(executive.TIME_RANGE(), timesteps[-1])
        return 1

def RequestData(self, request, inInfoVec, outInfoVec):
        outInfo = outInfoVec.GetInformationObject(0)
        executive = self.GetExecutive()
        if outInfo.Has(executive.UPDATE_TIME_STEP()):
            time = outInfo.Get(executive.UPDATE_TIME_STEP())
            time = 0

In RequestInformation, you’re saying only output-port 0 is time-varying data. Hence, VTK will not trigger an update for the second port’s pipeline. Truing setting TIME_STEPS and TIME_RANGE for both the output ports.

It works. Thank you very much .