By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,222 Members | 2,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,222 IT Pros & Developers. It's quick & easy.

trouble with pyvtk

P: n/a
Am trying to stumble through the demos for mayavi, after having set up
PyVTK-0.4.74 (together with numpy, scipy, vtk, and mayavi. I'm trying
to use pyvtk to generate a vtk dataset with the following:
>from Numeric import *
>>import scipy
import scipy.special
x = (arange(50.0)-25)/2.0
y = (arange(50.0)-25)/2.0
r = sqrt(x[:,NewAxis]**2+y**2)
z = 5.0*scipy.special.j0(r)
import pyvtk
z1 = reshape(transpose(z), (-1,))
point_data = pyvtk.PointData(pyvtk.Scalars(z1))
grid = pyvtk.StructuredPoints((50,50, 1), (-12.5, -12.5, 0), (0.5, 0.5, 1))
data = pyvtk.VtkData(grid, point_data)
data.tofile('/tmp/test.vtk')
All is well until the last line (writing the file), after which the
following error occurs:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/pyvtk/__init__.py", line 195,
in tofile
f.write(self.to_string(format))
File "/usr/lib/python2.4/site-packages/pyvtk/__init__.py", line 177,
in to_string
ret.append(self.point_data.to_string(format))
File "/usr/lib/python2.4/site-packages/pyvtk/Data.py", line 47, in
to_string
ret += [a.to_string(format) for a in self.data]
File "/usr/lib/python2.4/site-packages/pyvtk/Scalars.py", line 40,
in to_string
t = self.get_datatype(self.scalars)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype
r = self.get_datatype(o)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype
r = self.get_datatype(o)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype
r = self.get_datatype(o)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype

<snip<snip<snip<snip>

File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype
r = self.get_datatype(o)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 140,
in get_datatype
if is_int(obj): return self.default_int
RuntimeError: maximum recursion depth exceeded

I'm assuming my pyvtk installation is at issue here (?), but I don't
know enough about python to tell what has gone wrong, or how to fix
it. Can someone point me in the right direction?

May 18 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On May 18, 2:22 pm, LokiDawg <rsa4...@gmail.comwrote:

<snip>
All is well until the last line (writing the file), after which the
following error occurs:
<snip>
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 140,
in get_datatype
if is_int(obj): return self.default_int
RuntimeError: maximum recursion depth exceeded

I'm assuming my pyvtk installation is at issue here (?), but I don't
know enough about python to tell what has gone wrong, or how to fix
it. Can someone point me in the right direction?
This could be very well be a bug where infinite recursion happens, but
see if changing the recursion limit fixes this:
>>import sys
sys.getrecursionlimit()
1000
>>sys.setrecursionlimit(10000)
Regards,
Ondrej

May 18 '07 #2

P: n/a
On May 18, 12:41 am, obau...@gmail.com wrote:
>
This could be very well be a bug where infinite recursion happens, but
see if changing the recursion limit fixes this:
>import sys
sys.getrecursionlimit()
1000
>sys.setrecursionlimit(10000)
Regards,
Ondrej
Thanks for the tip, Ondrej. Unfortunately, this didn't do it, as pytvk
still ends up at the same place:

File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype
r = self.get_datatype(o)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 140,
in get_datatype
if is_int(obj): return self.default_int

RuntimeError: maximum recursion depth exceeded

I would be interested if anyone else has this difficulty with pyvtk--
Regards, Rolf

May 21 '07 #3

P: n/a
En Mon, 21 May 2007 02:11:46 -0300, LokiDawg <rs*****@gmail.comescribió:
Thanks for the tip, Ondrej. Unfortunately, this didn't do it, as pytvk
still ends up at the same place:

File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 149,
in get_datatype
r = self.get_datatype(o)
File "/usr/lib/python2.4/site-packages/pyvtk/common.py", line 140,
in get_datatype
if is_int(obj): return self.default_int

RuntimeError: maximum recursion depth exceeded
This looks like either a bug on pyvtk or maybe you making a circular
reference to something - either way I think you'll get more help from the
package developers.

--
Gabriel Genellina

May 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.