Thoughts about adding in a class that executes a Catalyst pipeline from Python code in a string

I’m thinking about adding in a class that would take a string of Python code instead of a file with Python code in it. The advantages of the new class include:

  • It gets around not being able to pass in arguments to the Python script which also allows me to use the same Python code multiple times with different arguments.
  • It compiles in all of the pipeline information into the code so no need to worry about file paths during execution, installation rules, etc. for Python files that would need to be accessed during the simulation run.
  • An advanced Catalyst user can probably create a string through the ParaView GUI that won’t need too much editing to get the pipeline they want.

My current use case is that I want to create a Point Source at user specified locations (possibly many) and output simulation results in a csv file based off of those locations. So with this, the user doesn’t need to know ParaView, Python or in situ techniques at all, just the desired locations and how to deal with csv files.

Just wanted to see what the community thought about this idea?

Andy, that seems reasonable like a reasonable capability to have.

By the way, it seems to me that it would be useful to add a point source to ParaView that has a property that has all the points you want to define. Poly Line Source can be used to do this currently, but also defines a poly line that isn’t needed. I’ve had need for a plain old point source recently.

In another, similar situation I think I just created a vtkPolyData with the needed points and corresponding vertex cells and input that into the a TrivialProducer. This would be pretty standard for Catalyst customization too. Never knew about the Poly Line Source so thanks for pointing me to that!

Cory, to clarify, you don’t just want the Source/ Alphabetical/ Point Source (which makes one point), but something like this that can make multiple points within the same filter?

That’s right. The Point Source is a little misnamed. It’s really a random point source confined to a spherical shape, though you can of course use it to specify a single point at a location. Since there is a lot of overhead in setting up a Point Source, if you want to define several or many point locations, it would be better to have a point source that lets you do that rather than set up many Point Sources.

You write it up, put my project on it?

Written up here: https://gitlab.kitware.com/paraview/paraview/issues/18586

Thanks.

To finish up the discussion here, the class that executes a Catalyst pipeline from a string has been merged into master with https://gitlab.kitware.com/paraview/paraview/merge_requests/2881 and will be in ParaView 5.7.