Jython question: RealTupleType throws TypeException(components must be non-null)

Dear VisADders,

I'm working my way through the VisAD tutorial, with the help of Tom's Jython supplements, so I'm basically re-writing each one in Jython, which is astoundingly easy. Still, I'm getting stuck on example 2.7 ('new units and changing the line width'). This fragment is pretty much verbatim from the java code, but throws an exception:

from visad import *
from visad.python.JPythonMethods import *

from visad.java2d import DisplayImplJ2D

t = getRealType("time", SI.second)
h = getRealType("height", SI.meter)
speed = getRealType("speed")#, SI.meter.divide(SI.second))

h_s_tuple = RealTupleType(h, speed)
func_t_tuple = FunctionType(t, h_s_tuple)


Traceback (innermost last):
  File "C:\VisADJython\example2_07.py", line 11, in ?
visad.TypeException: TupleType: components must be non-null
        at visad.TupleType.<init>(TupleType.java:58)
        at visad.RealTupleType.<init>(RealTupleType.java:171)

at the last line, where I call FunctionType(t, h_s_tuple). The really strange thing about this is that if I start up the Jython-VisAD command window, I can type in each line on its own without any problems like this.

Any ideas?


PhD, Computational Biologist,
Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA.
Tel: 617-432-3555 Fax: 617-432-3557 http://llama.med.harvard.edu/~fgibbons