On Jun 15, 2009, at 3:08 PM, Tom Boothby wrote: > > The error isn't in your code, I've duplicated this with much > simpler code. > > {{{ > %cython > from sage.rings.all import CC > def foo(z): > return CC(z) > }}} > > {{{ > complex_plot(foo,(0,1),(0,1)) > /// > Traceback (click to the left for traceback) > ... > TypeError: a float is required > }}} > > {{{ > complex_plot(lambda z: foo(z),(0,1),(0,1)) > /// > [pretty picture] > }}}
It looks like error is in adapt_to_callable, which probably doesn't recognize "builtin" (i.e. c defined) functions (being a different type than Python-defined ones). It should be converted to used fast_callable rather than fast_float anyways. - Robert > > > > On Mon, Jun 15, 2009 at 12:09 PM, Jason > Grout<jason-s...@creativetrax.com> wrote: >> >> I just tried to implement a quick, fast mandelbrot set plot. I >> posted >> my results (with the puzzling error) here: http://sagenb.org/home/ >> pub/578/ >> >> The error that I get is that when passing a Cython-created CC >> number to >> complex_plot, I get an error "float required"---something about the >> fast_float stuff. However, when I wrap that in a Python function >> which >> merely returns the exact same thing, there is no error. >> >> Can someone look at the worksheet and see offhand what the problem >> is? >> Is it an error in my code, in fast_float, complex_plot, or >> something else? >> >> Thanks, >> >> Jason >> >> >>> >> > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---