473,503 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble with pyvtk

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
3 1707
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1862
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following...
4
3827
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I...
0
1534
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and...
1
1986
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are...
6
3764
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
3
4969
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
1541
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it...
5
7713
by: Peter Pearson | last post by:
I'm trying to get started with pyvtk, the Python interface to the Visualization Toolkit, but there's obviously something important that I haven't figured out after an embarrassingly long morning...
0
1648
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.