MantisBT - ParaView
View Issue Details
0014184ParaView(No Category)public2013-07-25 13:032014-08-29 10:59
Alejandro Ribes 
Utkarsh Ayachit 
normalminorhave not tried
closedfixed 
4.0 
4.24.2 
ParaViS
refactor_python_tracing_2
incorrect functionality
0014184: CSV reader producing invalid Python trace
Attachments:
------------
sinus.csv - a simple CSV file containing 4 lines of two values (comma
separated)
trace_adr.py - ParaView generated Python trace

Description:
-------------
The Python trace generated by ParaView when importing the CSV file given
in attachment can not be re-executed.
Error trace:

   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File
"/export/home/adrien/my_salome/prereq/ParaView-4.0.1_INSTALL_Debug/lib/paraview-4.0/site-packages/paraview/simple.py",
line 300, in Show
       raise RuntimeError, "Could not create a representation object for
proxy %s" % proxy.GetXMLLabel()
   RuntimeError: Could not create a representation object for proxy CSV
Reader


Steps to reproduce
------------------
- open ParaView
- start Trace
- open the CVS file sinus.csv
- click Apply
- stop trace
- Run pvpython
- execute the lines of code given in the trace

PythonTrace
gz test-files.tar.gz (449) 2013-07-25 13:03
https://www.vtk.org/Bug/file/9482/test-files.tar.gz
Issue History
2013-07-25 13:03Alejandro RibesNew Issue
2013-07-25 13:03Alejandro RibesAssigned To => Utkarsh Ayachit
2013-07-25 13:03Alejandro RibesFile Added: test-files.tar.gz
2013-07-25 17:21Alan ScottNote Added: 0031333
2013-07-25 17:21Alan ScottSummaryCVS reader producing invalid Python trace => CSV reader producing invalid Python trace
2013-07-29 16:43Utkarsh AyachitNote Added: 0031362
2014-06-19 10:33Vadim SANDLERNote Added: 0032905
2014-06-22 18:19Utkarsh AyachitNote Added: 0032908
2014-06-22 18:20Utkarsh AyachitTarget Version => 4.2
2014-07-04 19:17Utkarsh AyachitTag Attached: PythonTrace
2014-07-09 21:53Utkarsh AyachitNote Added: 0033003
2014-07-18 21:00Utkarsh AyachitTopic Name => refactor_python_tracing_2
2014-07-18 21:00Utkarsh AyachitStatusbacklog => gatekeeper review
2014-07-18 21:00Utkarsh AyachitFixed in Version => git-next
2014-07-18 21:00Utkarsh AyachitResolutionopen => fixed
2014-07-22 08:32Utkarsh AyachitFixed in Versiongit-next => git-master
2014-07-22 08:32Utkarsh AyachitStatusgatekeeper review => customer review
2014-07-22 08:32Utkarsh AyachitNote Added: 0033055
2014-07-28 18:31Alan ScottNote Added: 0033114
2014-07-28 18:31Alan ScottStatuscustomer review => closed
2014-08-29 10:59Utkarsh AyachitFixed in Versiongit-master => 4.2

Notes
(0031333)
Alan Scott   
2013-07-25 17:21   
Correcting title. It is a CSV reader, not a CVS reader.
(0031362)
Utkarsh Ayachit   
2013-07-29 16:43   
The problem boils down to missing support for spreadsheet view in Python.
(0032905)
Vadim SANDLER   
2014-06-19 10:33   
Utkarsh,

The problem with the script generated via trace functionality is reproduced even in the GUI mode (not in pvpython), there are the steps to reproduce the problem:

- open ParaView
- start Trace
- open the CSV file sinus.csv
- click Apply
- stop trace
- save generated trace in the file
- Menu Tools -> Python Shell
- Run Script, select the created file
=>
  Traceback (most recent call last):
  File "<string>", line 12, in <module>
  File "/dn20/salome/rnv/PRODUCTS_BUILD/prefix/ParaView-4.1.0/lib/paraview-4.1/site-packages/paraview/servermanager.py", line 254, in __setattr__
    setter(self, value)
  File "/dn20/salome/rnv/PRODUCTS_BUILD/prefix/ParaView-4.1.0/lib/paraview-4.1/site-packages/paraview/servermanager.py", line 2477, in setProperty
    return self.SetPropertyWithName(propName, value)
  File "/dn20/salome/rnv/PRODUCTS_BUILD/prefix/ParaView-4.1.0/lib/paraview-4.1/site-packages/paraview/servermanager.py", line 309, in SetPropertyWithName
    prop.SetData(arg)
  File "/dn20/salome/rnv/PRODUCTS_BUILD/prefix/ParaView-4.1.0/lib/paraview-4.1/site-packages/paraview/servermanager.py", line 730, in SetData
    self.SMProperty.SetElement(idx, self.ConvertValue(val))
  File "/dn20/salome/rnv/PRODUCTS_BUILD/prefix/ParaView-4.1.0/lib/paraview-4.1/site-packages/paraview/servermanager.py", line 885, in ConvertValue
    raise ValueError("%s is not a valid value." % value)
ValueError: Row Data is not a valid value.

Regards,
Roman.
(0032908)
Utkarsh Ayachit   
2014-06-22 18:19   
Vadim,

FYI, I am working on refactoring the Python tracing framework. I'll make sure this is handled better in this refactor.

Utkarsh
(0033003)
Utkarsh Ayachit   
2014-07-09 21:53   
Developer note:

This is what the current trace generate produces

====================================================
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'CSV Reader'
sinuscsv = CSVReader(FileName=['/tmp/sinus.csv'])

# get active view
renderView0 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView0.ViewSize = [1387, 796]

# get layout
viewLayout0 = GetLayout()

# Create a new 'SpreadSheet View'
spreadSheetView0 = CreateView('SpreadSheetView')
# uncomment following to set a specific view size
# spreadSheetView0.ViewSize = [400, 400]

# place view in the layout
viewLayout0.AssignView(2, spreadSheetView0)

# show data in view
sinuscsvDisplay = Show(sinuscsv, spreadSheetView0)

#### saving camera placements for all active views

# current camera placement for renderView0

#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).
==============================================================================
(0033055)
Utkarsh Ayachit   
2014-07-22 08:32   
---------------------------------------------
Topics merged into master:
        0014874_fix_scalar_opacity_unit_distance
        14834_fix_representation_update
        dashboard-warnings-20140721
        refactor_python_tracing_2
(0033114)
Alan Scott   
2014-07-28 18:31   
Tested master, remote server, Linux.