[Sugar-devel] Calculate bug, help!

Gary Martin garycmartin at googlemail.com
Tue Jul 20 22:54:56 EDT 2010

Hi Reinier,

On 20 Jul 2010, at 00:45, Reinier Heeres wrote:

> 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).

Understood, well I think I do, just glad the AstParser scariness has a good reason for being there :)

> 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.

Tested here, works great and also fixes the bug in the sci/exp button as well :)) I'm cursing myself a little as I had been playing around with a helper function in functions.py without luck, but hadn't considered what was really needed was a helper class.

> 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.

That would be fab!

One thing to note is that v31 in git all this time with the new toolbar support has never been officially released. My plan was to try and hit a few low hanging bugs in trac (failed that one) and get a release out the door, perhaps just in time to have it added to the next Soas release (feature freeze is next week and I'd need to convince someone to package it for fedora, at least there are no binary blobs to worry about). Does that fit in with your schedule? I could do the release bit, ASLO, update wikis, upload the source, if you are pushed for time this week?


> 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
> <fix_angle_scaling.diff>

More information about the Sugar-devel mailing list