On 18 nov, 13:52, Burcin Erocal <bur...@erocal.org> wrote: > Hi Florent, > > On Thu, 17 Nov 2011 14:44:35 +0100 > > > > > > > > > > Florent Hivert <florent.hiv...@lri.fr> wrote: > > On Wed, Nov 16, 2011 at 03:48:10PM +0100, Burcin Erocal wrote: > > > On Wed, 16 Nov 2011 15:10:54 +0100 > > > Florent Hivert <florent.hiv...@lri.fr> wrote: > > > > > > Pynac supports indexed expressions already. It just isn't > > > > > wrapped in Sage yet. Again, there is an experimental patch > > > > > available: > > > > > >http://sage.math.washington.edu/home/burcin/indexed_expression-201107... > > > > > > Since you can wrap any hashable Python object in a symbolic > > > > > expression with SR._force_pyobject(), this could replace your > > > > > IndexedVarExpr class. > > > > > > I would appreciate any help with cleaning up these patches, > > > > > adding doctests etc. so they can be merged. :) > > > > > I'll try to cleanup this one, though I don't know anything about > > > > Pynac's internal... Is there a lot more work to do than adding > > > > doctests ? > > > > It should be only doctests, but you never know what comes up. :) > > > > I haven't looked at the patch in detail. I don't recall if any low > > > level modification is needed. I'll be on IRC if you run into > > > anything. > > > I'm at a conference so I don't have that much time working on it right > > now. I'll probably have more time next week. > > > My two first attempts weren't successful: first of all, it seems that > > you cannot index variables by any Python objects, only integers or > > sequences of thereof. I typically want to put permutations, trees or > > group elements in the index. Is that a limitation of Pynac or of your > > wrapper ? > > This was a limitation of the wrapper. It tries to coerce the argument > to SR. If Pynac doesn't need to do any arithmetic with these objects, > one can skip the coercion rules with the SR._force_pyobject() function. > > I updated the patch to allow arbitrary (hashable) Python objects and > omit the dimension argument. > > > Second, I got some Segfault so there is probably more work that only > > doctest. I have to investigate more to get a simple reproducible > > behavior. Can you check that I have the latest version of your patch: > > it is called: indexed_expression-20110727.patch > > That was the latest version. :) Here is a new one: > > http://sage.math.washington.edu/home/burcin/indexed_expression_201111... > > Note that I never actually used this. It is possible that there are > problems. I can try to fix these when you have a simple example. > > It's possible that your segfault is caused by #9880. We are trying to > finish that ticket off for the next release. Unfortunately, I am really > short on time these days. I am too... Anyway I'll try to have a look at the "match" problem this week-end, leaving us with doctests only hopefully. > > Cheers, > Burcin
-- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org