[Paraview] Gathering information about python wrappers
Erik Anderson
eranders at sci.utah.edu
Wed Aug 4 17:52:08 EDT 2010
Hi all,
I am trying to gather information about the Python-wrapped classes
provided by the paraview.simple API. So far, I have a script that uses
some introspection and gets a lot done, but I'm left with a strange
abort trap before things complete (in addition to some other strange
errors). The following script will reproduce all errors that I've seen
and cannot explain.
>>> import paraview.simple as pv
paraview version 3.8.0, Date: 2010-03-26
# Some modules don't seem to like being instantiated at all...
>>> forbidden = ["AlltoN", "Balance", "CTHSurface"]
# Grab all possible objects from the package
>>> l = dir(pv)
# Just create an object for each module and then destroy it to make sure
we can get through the list...
>>> for m in l:
# If it doesn't like being created, just skip it for now.
>>> if forbidden.__contains__(m):
>>> continue
# Grab a handle to the wrapper
>>> mod = getattr(pv, m)
# Make sure it's a createable object.
>>> if hasattr(mod, "func_name"):
>>> if mod.func_name == "CreateObject":
# Create it and then delete it... This will eventually be necessary to
inspect it's class methods.
>>> pv_instance = getattr(pv, m)()
>>> del pv_instance
One of the questionable errors that does NOT cause the script to fail
and exit -- I've found that this happens upon instantiation of the Clip
module (although a handful of others show this as well):
ERROR: In
/Users/erikanderson/env/ParaView-3.8.0/VTK/Filtering/vtkExecutive.cxx,
line 756
vtkCompositeDataPipeline (0x10ac101a0): Algorithm
vtkPVArrayCalculator(0x10ac0dbe0) returned failure for request:
vtkInformation (0x10ac37ed0)
Debug: Off
Modified Time: 182297
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA_OBJECT
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0
ERROR: In
/Users/erikanderson/env/ParaView-3.8.0/Servers/Common/vtkPVClassNameInformation.cxx,
line 47
vtkPVClassNameInformation (0x10ac37e00): Cannot get class name from NULL
object.
ERROR: In
/Users/erikanderson/env/ParaView-3.8.0/Servers/ServerManager/vtkSMOutputPort.cxx,
line 338
vtkSMOutputPort (0x10ac38070): Missing data information.
ERROR: In
/Users/erikanderson/env/ParaView-3.8.0/VTK/Filtering/vtkExecutive.cxx,
line 756
vtkCompositeDataPipeline (0x10ac101a0): Algorithm
vtkPVArrayCalculator(0x10ac0dbe0) returned failure for request:
vtkInformation (0x10ac37ed0)
Debug: Off
Modified Time: 182297
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA_OBJECT
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0
ERROR: In
/Users/erikanderson/env/ParaView-3.8.0/Servers/Common/vtkPVDataInformation.cxx,
line 588
vtkPVDataInformation (0x10ac38280): Could not cast object to a known
data set: vtkAlgorithmOutput
The fatal error:
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Abort trap
This happens after instantiation of the Ribbon module; however, if I
skip a few it happens at another one down the line.
Any help on this would be great!
Thanks,
Erik Anderson
More information about the ParaView
mailing list