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.cellContainsPoint(inputs, locations)[source]
paraview.detail.calculator.compute(inputs, expression, ns=None, multiline=False)[source]
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.

paraview.detail.calculator.get_data_time(self, do, ininfo)[source]
paraview.detail.calculator.pointIsNear(locations, distance, inputs)[source]