Python Reader Plugin: change output names at runtime

Hello everyone. First of all thanks for paraview and the great python plugin support!

Is there some API to change the name of the output after the filename was set?
Context:
I started off the VTKAlgorithmBase based csv reader example and managed to read multiple vtkPolydata from my hdf5 based files. The number of vtkPolydata and their names are not known beforehand. But hardcoding to 10 should suffice for now. But then it would be nice to have human-readable names. I hoped for FillOutputPortInformation, but that seems to be for output types only.

I figure that changing the number of ports is not possible with VTKPythonAlgorithmBase. Maybe directly with vtkAlgorithm as it has the Initialize() method.

You can’t renamed sources at the VTK level where you are writing code, but you can at the ParaView Python scripting level. After loading your datasets, you can write a script that executes in ParaView’s Python Shell. Some functions to help you:

# Get a list of sources
sources = list(GetSources().values())

# Rename source 0
RenameSource('new name', sources[0])

Thank you for the quick response.

Sorry if I didn’t make it clear. I’d like to rename the Output-0… Output-9. Not the source itself.
Is it possible to automatically trigger this script from the reader?

My bad. There is XML to do this at the proxy level in regular ParaView plugins:

      <OutputPort index="0"
                  name="Volume Data" />
      <OutputPort index="1"
                  name="Tracers" />
      <OutputPort index="2"
                  name="Markers" />

Unfortunately, I don’t know if you can supply such XML with a decorator at the proxy level at present. You can at the property level I know.