[Paraview] some tables cannot be located using paraview.simple python api

Laurent Vanboquestal laurent.vanboquestal at gmail.com
Fri Nov 26 04:58:48 EST 2010


I found the problem ... In fact, the th z table is refering to Velocity in
my case)... and the for the non-working cases, range are between [0, 0]
And it seems to give problems as this table is used by Glyph2 ....


On Fri, Nov 26, 2010 at 10:11 AM, Laurent Vanboquestal <
laurent.vanboquestal at gmail.com> wrote:

> Hello,
>
> I got this message "Could not locate array z in the input" executing code
> coming from Python Trace using Paraview 3.8.1
>
> Any Idea?
>
> The weird things is that my sample code is working fine with some pvd file
> (using vtu files), but not with some others ....
> However, I can open the "non-working" one with paraview
>
> The code executed is coming from the Python trace of Paraview 3.8.1
> Is there a workaround for this kind of issues?
>
> python test_view2.py
> vtkPVDReader : [ ...........]
> vtkPVArrayCalculator : [ ...........]
> vtkPVArrayCalculator : [ ...........]
> vtkThreshold : [ ...........]
>
> Traceback (most recent call last):
>  File "test_view2.py", line 297, in <module>
>    my_representation7.ColorArrayName = 'z'
>  File
> "/usr/local/ParaView-3.8.1-Linux-x86_64/lib/paraview-3.8/site-packages/paraview/servermanager.py",
> line 204, in __setattr__
>    setter(self, value)
>  File
> "/usr/local/ParaView-3.8.1-Linux-x86_64/lib/paraview-3.8/site-packages/paraview/servermanager.py",
> line 2364, in setProperty
>    return self.SetPropertyWithName(propName, value)
>  File
> "/usr/local/ParaView-3.8.1-Linux-x86_64/lib/paraview-3.8/site-packages/paraview/servermanager.py",
> line 253, in SetPropertyWithName
>    prop.SetData(arg)
>  File
> "/usr/local/ParaView-3.8.1-Linux-x86_64/lib/paraview-3.8/site-packages/paraview/servermanager.py",
> line 684, in SetData
>    raise ValueError("Could not locate array %s in the input." % arr)
> ValueError: Could not locate array z in the input.
>
> Do you have any idea or workaround to avoid this?
>
> Thanks a lot for your help,
>
> Best Regards,
>
> Laurent
>
> On Tue, Aug 31, 2010 at 4:25 PM, pat marion <pat.marion at kitware.com>wrote:
>
>> Laurent sent me the data off list.  I took a look at it and determined the
>> problem is something that has already been corrected since the 3.8 release.
>> Here is the problem and how to fix it for those users with v3.8:
>>
>> clip = Clip(...)
>> ...code constructs representations and sets display properties...
>> clip.ClipType.Origin = [...]
>> clip.ClipType.Normal = [...]
>>
>> What is happening is the clip filter is constructed, some properties are
>> set in the constructor, but the properties defining the clip plane are not
>> set until the end of the python script.  It is fixed by just moving the code
>> to just after the constructor:
>>
>> clip = Clip(...)
>> clip.ClipType.Origin = [...]
>> clip.ClipType.Normal = [...]
>> ...code constructs representations and sets display properties...
>>
>> This issue will occur for the clip, cut, glyph, and possibly other
>> filters.  It was fixed on April 30 with git commit d9119f6be4b10 and exists
>> in the release branch as well.
>>
>> Pat
>>
>>
>>
>> On Tue, Aug 31, 2010 at 3:18 AM, Laurent Vanboquestal <
>> laurent.vanboquestal at gmail.com> wrote:
>>
>>> Hello Pat,
>>>
>>> It has been generated using the "trace state button" .... The generated
>>> code is huge (about 900 lines of python code),
>>>
>>> Regards,
>>>
>>> Laurent
>>>
>>>
>>> On Mon, Aug 30, 2010 at 5:59 PM, pat marion <pat.marion at kitware.com>wrote:
>>>
>>>> How are you generating the python trace?  Is it recorded using the
>>>> start/stop trace buttons, or using the trace state button?  Is it possible
>>>> to attach the python trace script and/or the dataset?
>>>>
>>>> Pat
>>>>
>>>> On Mon, Aug 30, 2010 at 10:28 AM, Laurent Vanboquestal <
>>>> laurent.vanboquestal at gmail.com> wrote:
>>>>
>>>>>  Hi all,
>>>>>
>>>>> I got some problems with the generated python code using paraview 3.8
>>>>> (Python Trace State).
>>>>>
>>>>> Using paraview GUI, I can load my pvsm file and when selecting "Glyph2"
>>>>> in the pipeline browser, I
>>>>> can set values like 'Solid Color', 'cellNormal', 'Velocity_Bis', ...
>>>>>
>>>>> However, when executing the generated code using pvpython, I got this
>>>>> error:
>>>>>
>>>>> vtkPVDReader : [ ...........]
>>>>> vtkPVArrayCalculator : [ ...........]
>>>>> vtkPVArrayCalculator : [ ...........]
>>>>> vtkWarpVector : [ ...........]
>>>>> vtkPVClipDataSet : [ ...........]
>>>>> vtkPVArrowSource : [ ...........]
>>>>> vtkPVGlyphFilter : [ ...........]
>>>>> Traceback (most recent call last):
>>>>>   File "p5.py", line 365, in <module>
>>>>>     DataRepresentation13.ColorArrayName = 'Velocity_bis'
>>>>>   File
>>>>> "/home/kitware/Dashboard/MyTests/ParaView-3-8/ParaView-3.8/ParaViewBin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
>>>>> line 204, in __setattr__
>>>>>   File
>>>>> "/home/kitware/Dashboard/MyTests/ParaView-3-8/ParaView-3.8/ParaViewBin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
>>>>> line 2361, in setProperty
>>>>>   File
>>>>> "/home/kitware/Dashboard/MyTests/ParaView-3-8/ParaView-3.8/ParaViewBin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
>>>>> line 253, in SetPropertyWithName
>>>>>   File
>>>>> "/home/kitware/Dashboard/MyTests/ParaView-3-8/ParaView-3.8/ParaViewBin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
>>>>> line 681, in SetData
>>>>> ValueError: Could not locate array Velocity_bis in the input.
>>>>>
>>>>> Any idea? Or advice to tackle this issue?
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Laurent
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the ParaView Wiki at:
>>>>> http://paraview.org/Wiki/ParaView
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.paraview.org/mailman/listinfo/paraview
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20101126/40d44b05/attachment-0001.htm>


More information about the ParaView mailing list