[Sugar-devel] Calculate bug, help!

Reinier Heeres reinier at heeres.eu
Mon Jul 19 19:45:21 EDT 2010


Hi Gary,

I agree that the AstParser class is a bit scary, but I still believe
it's a good ingredient for Calculate: it allows us to do symbolic
evaluation of functions. This brings us the features of plotting
graphs and using not-completely-resolved functions in later
calculations. This would be quite a bit harder otherwise (not to
mention that the previous parser was a hideous piece of code).

Anyway, I have attached a patch to fix the bug you mentioned. If you
can have a look whether you agree I'll push it asap. I'm trying to get
back to writing some sugar activity code in the coming time, so I hope
to get a few more Calculate bugs out of the way as well.

Cheers,
Reinier

On Mon, Jul 19, 2010 at 6:11 AM, Gary C Martin
<garycmartin at googlemail.com> wrote:
> Hi Reinier,
>
> Help! :)
>
> I've burnt a week of misc free time trying to untangle this deg/rad bug, but it's a nightmare for me and I seem to have got nowhere. Any hints much appreciated:
>
>        http://bugs.sugarlabs.org/ticket/1111
>
> After much poking I discovered you implemented some type of custom plugin system (in the rather scary AstParser class) for the 'functions.py' and 'constants.py' code, which seems to do some magic import tricks that seem to prevent obvious access to accessing the 'functions.py' variable _angle_scaling from the outside, and/or blocking the 'functions.py' plugin code from accessing that value from the outside. The toolbar code changes the angle_scaling property in the MathLib class, but that value is never used by the actual imported AstParser function calls, and I've found no way to access the actuall deg/rad scaling value to change it from the outside.
>
> Thanks for any hints.
>
> Regards,
> --Gary



-- 
Reinier Heeres
Tel: +31 6 10852639
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_angle_scaling.diff
Type: text/x-patch
Size: 3340 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100720/841cb58a/attachment.bin 


More information about the Sugar-devel mailing list