Paraview quits when I use the programmable source

Hi there,

I don’t know if this is because of the programmable source I wrote or what, but Paraview quits if I apply the code below to the programmable source:
`import numpy as np
from paraview import vtk

fname = ‘Path/to/tmp.txt’
ret = np.loadtxt(fname).view(complex)

def ani(i, x, omega):
x = x * np.exp(1jomegai)
return np.real(x)

def ani_2(i, x, omega):
x = x * np.exp(1jomegai)
return np.imag(x)

N = 40
omega = 2.*np.pi / N

ret = np.loadtxt(fname).view(complex)
numPoints = ret.shape[0] * ret.shape[1]
dims = [ret.shape[0], ret.shape[1], 1]
output = self.GetOutput()
output.SetDimensions(dims)

newPoints = vtk.vtkPoints()
newPoints.Allocate(dims[0] * dims[1] * dims[2])

ca = vtk.vtkDoubleArray()
ca.SetName(“temp”)
ca.SetNumberOfComponents(2)
ca.SetNumberOfTuples(numPoints)
v = [0.0] * 3
val = ani(0, ret, omega)
val2 = ani_2(0, ret, omega)

for i in range(0, ret.shape[0]):
for j in range(0, ret.shape[1]):
x = i + 1
y = j + 1
z = 0
newPoints.InsertPoint(i * ret.shape[0] + j, x, y, z)
ca.InsertTuple(i * ret.shape[0] + j,(val[i][j], val2[i][j]))

pdo.SetPoints(newPoints)
pdo.GetPointData().SetScalars(ca)
`

May I check what might be the problem?
Thanks!