detail.calculator Module¶
This module is used by vtkPythonCalculator. It encapsulates the logic implemented by the vtkPythonCalculator to operate on datasets to compute derived quantities.
- paraview.detail.calculator.execute(self, expression, multiline=False)[source]¶
Internal Method Called by vtkPythonCalculator in its RequestData(…) method. This is not intended for use externally except from within vtkPythonCalculator::RequestData(…).
Note: by default, the output attribute respect self.GetArrayAssociation(). As some exposed methods (defined by the VTK numpy wrapping) can change the shape, they can also override the output attribute. For instance, volume() will target CellData attribute. FieldData cannot be overridden, as it always can handle any shape of arrays.
- paraview.detail.calculator.get_arrays(attribs, controller=None)[source]¶
Returns a ‘dict’ referring to arrays in dsa.DataSetAttributes or dsa.CompositeDataSetAttributes instance.
When running in parallel, this method will ensure that arraynames are reduced across all ranks and for any arrays missing on the local process, a NoneArray will be added to the returned dictionary. This ensures that expressions evaluate without issues due to missing arrays on certain ranks.