Programmable filter script path

Hi all,

I have a script as follows:

merge_data =  MergeBlocks(nek3d)

# Extract selection of data for 1.0<T<7.5 in a range
#(temperature > 1.0) & (temperature < 7.5)
selection.QueryString="(temperature >1.0) & (temperature <= 7.5)"
selection.FieldType = 'POINT'
mySelection = ExtractSelection(Input=merge_data, Selection=selection)

# create new programmable filters
analysis = ProgrammableFilter(Input=mySelection)
analysis.Script = """
import numpy as np
import numpy.linalg as nl
from paraview import numpy

The script works fine.
However, the analysis script is so long and I prefer to have it in the separate (python) file for readability purposes.
Something like


Is it possible to do that?

Thanks in advance

You should be able to read your script, dump it into a string and pass it as an argument.

That being said, it would be nice to provide a file based api for the programmable filter.

Thanks. But what is the argument?
Something like


Maybe I misexplained.

You need to read the file yourself using standard python file reading tools (open,, …), then store the content into a string that will be passed as an argument.