Yes, I attached the error messages (using pvpython and running the script from the gui) and scripts; the original state file pvsm works fine. The script 'test.py' (with two different error messages testError*) is the one, which was saved as a state file and 'pyCalculator.py' (errormsg.txt) the one which was created using 'Start trace' and 'stop trace'...

Best Regards!
Fabian



On 02/05/2011 11:11 PM, pat marion wrote:
Hi Fabian,

Could you elaborate a little on the problem you are experiencing with
the python calculator or programmable filter used with python state files?

Pat

On Sat, Feb 5, 2011 at 8:15 AM, Fabian Braennstroem
<[email protected] <mailto:[email protected]>> wrote:

    Hi,

    quite nice release!

    I would like to report some issues on my machine...

    - there is the cgns reader missing (if I understood it correct from
    the release notes, there should be one)
    - for OpenFOAM file formats one often has just a '.foam' file in the
    case directory without a prefix... this is not displayed anymore in
    the open dialog
    - it seems that the python calculator or programmable filter is not
    working completely using a python state file
    - there is a segmentation fault when I run the attached script (this
    happened as well, when I tried to set it up with the gui for the
    first time; the second try it worked without a segmentation fault);
    if needed I could send the data!?

    Best Regards!
    Fabian

    _______________________________________________
    Powered by www.kitware.com <http://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



<<attachment: test.png>>

try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

a_foam = FindSource(".foam")
DataRepresentation1 = GetDisplayProperties(a_foam)
Slice1 = FindSource("Slice1")
DataRepresentation2 = GetDisplayProperties(Slice1)
PythonCalculator1 = GetActiveSource()
DataRepresentation3 = GetDisplayProperties(PythonCalculator1)
RenderView1 = CreateRenderView()
RenderView1.LightSpecularColor = [1.0, 1.0, 1.0]
RenderView1.InteractionMode = '3D'
RenderView1.UseTexturedBackground = 0
RenderView1.UseLight = 1
RenderView1.CameraPosition = [-9.14272684567991, 4.270711208834679, 21.470211339214494]
RenderView1.FillLightKFRatio = 3.0
RenderView1.Background2 = [0.0, 0.0, 0.165]
RenderView1.FillLightAzimuth = -10.0
RenderView1.LODResolution = 50.0
RenderView1.BackgroundTexture = []
RenderView1.HeadPose = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]
RenderView1.KeyLightAzimuth = 10.0
RenderView1.StencilCapable = 1
RenderView1.LightIntensity = 1.0
RenderView1.CameraFocalPoint = [3.9998940504849543, 0.6872018716135457, 1.0001793989389938]
RenderView1.ImageReductionFactor = 2
RenderView1.CameraViewAngle = 30.0
RenderView1.CameraParallelScale = 6.363961030678928
RenderView1.EyeAngle = 2.0
RenderView1.HeadLightKHRatio = 3.0
RenderView1.StereoRender = 0
RenderView1.KeyLightIntensity = 0.75
RenderView1.BackLightAzimuth = 110.0
RenderView1.OrientationAxesInteractivity = 0
RenderView1.UseInteractiveRenderingForSceenshots = 0
RenderView1.UseOffscreenRendering = 0
RenderView1.Background = [0.31999694819562063, 0.3400015259021897, 0.4299992370489052]
RenderView1.UseOffscreenRenderingForScreenshots = 1
RenderView1.NonInteractiveRenderDelay = 0
RenderView1.CenterOfRotation = [5.0, 1.5, 1.5]
RenderView1.CameraParallelProjection = 0
RenderView1.CompressorConfig = 'vtkSquirtCompressor 0 3'
RenderView1.HeadLightWarmth = 0.5
RenderView1.MaximumNumberOfPeels = 4
RenderView1.LightDiffuseColor = [1.0, 1.0, 1.0]
RenderView1.StereoType = 'Red-Blue'
RenderView1.DepthPeeling = 1
RenderView1.BackLightKBRatio = 3.5
RenderView1.StereoCapableWindow = 0
RenderView1.CameraViewUp = [0.05203448670267873, 0.988826178575929, -0.139696817274102]
RenderView1.LightType = 'HeadLight'
RenderView1.LightAmbientColor = [1.0, 1.0, 1.0]
RenderView1.RemoteRenderThreshold = 3.0
RenderView1.KeyLightElevation = 50.0
RenderView1.CenterAxesVisibility = 1
RenderView1.MaintainLuminance = 0
RenderView1.StillRenderImageReductionFactor = 1
RenderView1.BackLightWarmth = 0.5
RenderView1.FillLightElevation = -75.0
RenderView1.MultiSamples = 0
RenderView1.FillLightWarmth = 0.4
RenderView1.AlphaBitPlanes = 1
RenderView1.LightSwitch = 0
RenderView1.OrientationAxesVisibility = 1
RenderView1.CameraClippingRange = [15.040536714918481, 36.66663092674132]
RenderView1.BackLightElevation = 0.0
RenderView1.ViewTime = 2000.0
RenderView1.OrientationAxesOutlineColor = [1.0, 1.0, 1.0]
RenderView1.LODThreshold = 5.0
RenderView1.CollectGeometryThreshold = 100.0
RenderView1.UseGradientBackground = 0
RenderView1.KeyLightWarmth = 0.6
RenderView1.OrientationAxesLabelColor = [1.0, 1.0, 1.0]

a1_p_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 1.0, 1.0] )

a1_result_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 1.0, 1.0] )

a1_p_PVLookupTable = GetLookupTableForArray( "p", 1, Discretize=1, RGBPoints=[-0.02978450059890747, 0.23, 0.299, 0.754, 0.03493242710828781, 0.706, 0.016, 0.15], UseLogScale=0, VectorComponent=0, NanColor=[0.25, 0.0, 0.0], NumberOfTableValues=256, ColorSpace='Diverging', VectorMode='Magnitude', HSVWrap=0, ScalarRangeInitialized=1.0, LockScalarRange=0 )

a1_result_PVLookupTable = GetLookupTableForArray( "result", 1, Discretize=1, RGBPoints=[0.0, 0.23, 0.299, 0.754, 0.0, 0.706, 0.016, 0.15], UseLogScale=0, VectorComponent=0, NanColor=[0.25, 0.0, 0.0], NumberOfTableValues=256, ColorSpace='Diverging', VectorMode='Magnitude', HSVWrap=0, ScalarRangeInitialized=1.0, LockScalarRange=0 )

ScalarBarWidgetRepresentation1 = CreateScalarBar( Title='p', Position2=[0.13, 0.5], TitleOpacity=1.0, TitleShadow=0, AutomaticLabelFormat=1, TitleFontSize=12, TitleColor=[1.0, 1.0, 1.0], AspectRatio=20.0, NumberOfLabels=5, ComponentTitle='', Resizable=1, TitleFontFamily='Arial', Visibility=0, LabelFontSize=12, LabelFontFamily='Arial', TitleItalic=0, Selectable=0, LabelItalic=0, Enabled=0, LabelColor=[1.0, 1.0, 1.0], Position=[0.87, 0.25], LabelBold=0, UseNonCompositedRenderer=1, LabelOpacity=1.0, TitleBold=0, LabelFormat='%-#6.3g', Orientation='Vertical', LabelShadow=0, LookupTable=a1_p_PVLookupTable, Repositionable=1 )
GetRenderView().Representations.append(ScalarBarWidgetRepresentation1)

ScalarBarWidgetRepresentation2 = CreateScalarBar( Title='result', Position2=[0.13, 0.5], TitleOpacity=1.0, TitleShadow=0, AutomaticLabelFormat=1, TitleFontSize=12, TitleColor=[1.0, 1.0, 1.0], AspectRatio=20.0, NumberOfLabels=5, ComponentTitle='', Resizable=1, TitleFontFamily='Arial', Visibility=1, LabelFontSize=12, LabelFontFamily='Arial', TitleItalic=0, Selectable=0, LabelItalic=0, Enabled=1, LabelColor=[1.0, 1.0, 1.0], Position=[0.87, 0.25], LabelBold=0, UseNonCompositedRenderer=1, LabelOpacity=1.0, TitleBold=0, LabelFormat='%-#6.3g', Orientation='Vertical', LabelShadow=0, LookupTable=a1_result_PVLookupTable, Repositionable=1 )
GetRenderView().Representations.append(ScalarBarWidgetRepresentation2)

DataRepresentation1.Source.ShaftResolution = 6
DataRepresentation1.Source.TipLength = 0.35
DataRepresentation1.Source.ShaftRadius = 0.03
DataRepresentation1.Source = "Arrow"
DataRepresentation1.Source.Invert = 0
DataRepresentation1.Source.TipResolution = 6
DataRepresentation1.Source.TipRadius = 0.1

DataRepresentation2.Source.ShaftResolution = 6
DataRepresentation2.Source.TipLength = 0.35
DataRepresentation2.Source.ShaftRadius = 0.03
DataRepresentation2.Source = "Arrow"
DataRepresentation2.Source.Invert = 0
DataRepresentation2.Source.TipResolution = 6
DataRepresentation2.Source.TipRadius = 0.1

DataRepresentation3.Source.ShaftResolution = 6
DataRepresentation3.Source.TipLength = 0.35
DataRepresentation3.Source.ShaftRadius = 0.03
DataRepresentation3.Source = "Arrow"
DataRepresentation3.Source.Invert = 0
DataRepresentation3.Source.TipResolution = 6
DataRepresentation3.Source.TipRadius = 0.1

Render()
64/bin/pvpython test.py .7 > ~/Desktop/ParaView-3.10.0-RC1-Linux-x86_6
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    DataRepresentation1 = GetDisplayProperties(a_foam)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/simple.py",
 line 180, in GetDisplayProperties
    return GetRepresentation(proxy, view)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/simple.py",
 line 169, in GetRepresentation
    rep = servermanager.GetRepresentation(proxy, view)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/servermanager.py",
 line 2037, in GetRepresentation
    for rep in view.Representations:
AttributeError: 'NoneType' object has no attribute 'Representations'
[ceplx049] 01__56T_SST_1.7 > 
Python 2.7 (r27:82500, Feb  1 2011, 21:41:40) 
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
>>> from paraview.simple import *
paraview version 3.10.0-RC1, Date: 2011-01-28
>>> 
Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/simple.py",
 line 180, in GetDisplayProperties
    return GetRepresentation(proxy, view)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/simple.py",
 line 171, in GetRepresentation
    rep = servermanager.CreateRepresentation(proxy, view)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/servermanager.py",
 line 2059, in CreateRepresentation
    raise RuntimeError, "proxy argument cannot be None."
RuntimeError: proxy argument cannot be None.
>>> 
vtkPOpenFOAMReader : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkCutter : [ ...........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ .Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 9, in RequestData
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 137, in __getitem__
    return self.GetArray(idx)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 144, in GetArray
    array = vtkDataArrayToVTKArray(vtkarray, self.DataSet())
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 36, in vtkDataArrayToVTKArray
    narray = numpy_support.vtk_to_numpy(array)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/numpy_support.py",
 line 215, in vtk_to_numpy
    result = numpy.frombuffer(vtk_array, dtype=dtype)
ValueError: offset must be non-negative and smaller than buffer lenth (0)
..........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ .Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 9, in RequestData
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 137, in __getitem__
    return self.GetArray(idx)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 144, in GetArray
    array = vtkDataArrayToVTKArray(vtkarray, self.DataSet())
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 36, in vtkDataArrayToVTKArray
    narray = numpy_support.vtk_to_numpy(array)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/numpy_support.py",
 line 215, in vtk_to_numpy
    result = numpy.frombuffer(vtk_array, dtype=dtype)
ValueError: offset must be non-negative and smaller than buffer lenth (0)
..........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ ...........]
vtkPythonCalculator : [ .Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 9, in RequestData
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 137, in __getitem__
    return self.GetArray(idx)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 144, in GetArray
    array = vtkDataArrayToVTKArray(vtkarray, self.DataSet())
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/vtk/dataset_adapter.py",
 line 36, in vtkDataArrayToVTKArray
    narray = numpy_support.vtk_to_numpy(array)
  File 
"/home/gcae504/Desktop/ParaView-3.10.0-RC1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/numpy_support.py",
 line 215, in vtk_to_numpy
    result = numpy.frombuffer(vtk_array, dtype=dtype)
ValueError: offset must be non-negative and smaller than buffer lenth (0)
..........]
vtkPythonCalculator : [ ...........]
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

a_foam = OpenFOAMReader( FileName='/home/gcae504/HOME/PORSCHE/scr/ceplx049/scr2/gcae504/Dissertation/3D_Nielsen/OpenFoam/01_SAS_SSTF_URANS/01__56T_SST_1.7/.foam' )

AnimationScene1 = GetAnimationScene()
RenderView1 = GetRenderView()
a_foam.CellArrays = ['k', 'nut', 'omega', 'p', 'U']
a_foam.MeshRegions = ['internalMesh']

AnimationScene1.EndTime = 2030.0
AnimationScene1.AnimationTime = 2000.0
AnimationScene1.PlayMode = 'Snap To TimeSteps'
AnimationScene1.StartTime = 2000.0

RenderView1.ViewTime = 2000.0

a_foam.CellArrays = ['k', 'nut', 'omega', 'p', 'U']
a_foam.MeshRegions = ['in', 'internalMesh', 'out', 'w-back', 'w-bottom', 'w-front', 'w-left', 'w-nchannel-ob', 'w-nchannel-side', 'w-otchannel', 'w-right', 'w-top']

DataRepresentation1 = Show()
DataRepresentation1.Representation = 'Outline'
DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]

RenderView1.CenterOfRotation = [5.0, 1.5, 1.5]

Slice1 = Slice( SliceType="Plane" )

RenderView1.CameraPosition = [-8.142620896164862, 5.083509337221133, 21.97003194027548]
RenderView1.CameraViewUp = [0.05203448670267873, 0.988826178575929, -0.139696817274102]
RenderView1.CameraFocalPoint = [5.0, 1.5, 1.5]
RenderView1.CameraClippingRange = [15.040536714918467, 36.666630926741306]
RenderView1.CameraParallelScale = 6.363961030678928

Slice1.SliceOffsetValues = [0.0]
Slice1.SliceType.Origin = [5.0, 1.5, 1.5]
Slice1.SliceType = "Plane"

DataRepresentation2 = Show()
DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]

RenderView1.CameraClippingRange = [8.394212848622715, 45.03298307260516]

Slice1.SliceType.Normal = [0.0, 0.0, 1.0]

PythonCalculator1 = PythonCalculator()

a1_p_PVLookupTable = GetLookupTableForArray( "p", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[-0.02978450059890747, 0.23, 0.299, 0.754, 0.03493242710828781, 0.706, 0.016, 0.15], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 )

a1_p_PiecewiseFunction = CreatePiecewiseFunction()

ScalarBarWidgetRepresentation1 = CreateScalarBar( Title='p', LabelFontSize=12, Enabled=1, LookupTable=a1_p_PVLookupTable, TitleFontSize=12 )
GetRenderView().Representations.append(ScalarBarWidgetRepresentation1)

RenderView1.CameraFocalPoint = [3.9998940504849543, 0.6872018716135457, 1.0001793989389938]
RenderView1.CameraPosition = [-9.14272684567991, 4.270711208834679, 21.470211339214494]
RenderView1.CameraClippingRange = [8.394212848622734, 45.03298307260518]

DataRepresentation2.ColorArrayName = 'p'
DataRepresentation2.LookupTable = a1_p_PVLookupTable

RenderView1.CameraClippingRange = [15.040536714918481, 36.66663092674132]

PythonCalculator1.Expression = "inputs[0].PointData['k']-inputs[0].PointData['k']"

DataRepresentation3 = Show()
DataRepresentation3.ColorArrayName = 'p'
DataRepresentation3.LookupTable = a1_p_PVLookupTable
DataRepresentation3.EdgeColor = [0.0, 0.0, 0.5000076295109483]

DataRepresentation2.Visibility = 0

a1_result_PVLookupTable = GetLookupTableForArray( "result", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[0.0, 0.23, 0.299, 0.754, 0.0, 0.706, 0.016, 0.15], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 )

a1_result_PiecewiseFunction = CreatePiecewiseFunction()

ScalarBarWidgetRepresentation2 = CreateScalarBar( Title='result', LabelFontSize=12, Enabled=1, LookupTable=a1_result_PVLookupTable, TitleFontSize=12 )
GetRenderView().Representations.append(ScalarBarWidgetRepresentation2)

ScalarBarWidgetRepresentation1.Enabled = 0
ScalarBarWidgetRepresentation1.Visibility = 0

DataRepresentation3.ColorArrayName = 'result'
DataRepresentation3.LookupTable = a1_result_PVLookupTable

Render()
_______________________________________________
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

Reply via email to