enthought / enthought/mayavi

traits.trait_errors.TraitError

Open
#806 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

It is a possible duplicate of #521, necessitating a need for a transition or porting guide.

I was playing around with http://www.nongnu.org/getfem/ equally https://savannah.nongnu.org/projects/getfem/ and encountered http://git.savannah.nongnu.org/cgit/getfem.git/tree/interface/tests/python/getfem_tvtk.py#n298 while running the demo http://git.savannah.nongnu.org/cgit/getfem.git/tree/interface/tests/python/demo_tripod.py#n145

It has the following traceback:

``` python
done!
nbcvs=2799, nbpts=5621, qdim=3, fem = FEM_PK(3,2), nbdof=16764
('test', array([-10. , -10. , -9.99999, ..., -4.54596, -7.27148,
-5.9042 ]))
running solve...
solve done!
('Von Mises range: ', 0.03205881875552084, 9.738551789035906)
*** GetFEM view of the workspace:
*** Python view of the workspace:
getfem.getfem.Mesh class 8, id 0 : instances=1
getfem.getfem.MeshFem class 9, id 1 : instances=1
getfem.getfem.MeshFem class 9, id 2 : instances=1
getfem.getfem.MeshFem class 9, id 3 : instances=1
getfem.getfem.MeshIm class 10, id 5 : instances=1
getfem.getfem.Model class 14, id 9 : instances=1
getfem.getfem.MeshFem class 9, id 10 : instances=1
getfem.getfem.Slice class 16, id 12 : instances=1
You can view the tripod with (for example) mayavi:
mayavi2 -d tripod.vtk -f WarpVector -m Surface
or
gmsh tripod.pos

Traceback (most recent call last):
File "/usr/share/octave/packages/python/demo_tripod.py", line 145, in
fig.show(mfu, deformation=U, data=(mfdu,VM), deformation_scale='20%')
File "/usr/share/octave/packages/python/getfem_tvtk.py", line 451, in show
self.show_mesh_fem(mf, **args)
File "/usr/share/octave/packages/python/getfem_tvtk.py", line 409, in show_mesh_fem
self.actors += it.vtk_actors()
File "/usr/share/octave/packages/python/getfem_tvtk.py", line 298, in vtk_actors
self.mapper = tvtk.PolyDataMapper(input_connection=data);
File "tvtk_classes/poly_data_mapper.py", line 45, in __init__
tvtk_base.TVTKBase.__init__(self, vtk.vtkPolyDataMapper, obj, update, **traits)
File "/usr/lib/python2.7/dist-packages/tvtk/tvtk_base.py", line 362, in __init__
super(TVTKBase, self).__init__(**traits)
File "tvtk_classes/algorithm.py", line 172, in _set_input_connection
self._wrap_call(self._vtk_obj.SetInputConnection, deref_vtk(obj))
File "/usr/lib/python2.7/dist-packages/tvtk/tvtk_base.py", line 595, in _wrap_call
ret = vtk_method(*args)
TypeError: SetInputConnection argument 1: method requires a vtkAlgorithmOutput, a vtkPolyData was provided.
>>>
```
May someone suggest how this example should be ported to the latest TVTK sources? One may have a brief look also at: https://stackoverflow.com/q/35089379

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with getfem_tvtk.py around line 298 and demo_tripod.py around line 145, then compare the traceback with the TVTK API changes referenced in the issue and #521. Done means identifying the required porting guidance or example changes so the demo no longer passes a vtkPolyData where a vtkAlgorithmOutput is expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.