#5538: [with patch; needs review] Family does copy its input + various
improvement.
---------------------------+------------------------------------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: new
Priority: major | Milestone: sage-3.4.2
Component: combinatorics | Keywords: Family, mutable input
---------------------------+------------------------------------------------
Comment(by hivert):
On irc, it was decided that we should take chance of this patch to finish
the cleanup of the interface of family. I've taken care of this but
several issues are still open:
1. The former implementation of family accepted a parameter "name" which
was never used and which was there to provide a functionality similar to
{{{SageObject.rename}}}. Therefore it should be removed. Is it ok to keep
it and raise a warning so that people in sage-combinat adapt their code
according to ?
2. On the other hand, for {{{LazyFamily}}} I can use the name of the
function to generate a proper name for the family. Here are some examples:
{{{
sage: def fun(i): 2*i
sage: f = LazyFamily([3,4,7], fun); f
Lazy family (fun(i))_{i in [3, 4, 7]}
sage: f = Family(Permutations(3), attrcall("to_lehmer_code"), lazy=True);
f
Lazy family (i.to_lehmer_code())_{i in Standard permutations of 3}
sage: f = LazyFamily([3,4,7], lambda i: 2*i); f
Lazy family (<lambda>(i))_{i in [3, 4, 7]}
}}}
Is this ok ? In particular the last one used to be printed
{{{
Lazy family (f(i))_{i in [3, 4, 7]}
}}}
I find {{{<lambda>}}} more explicit.
3. To have a single interface it was also decided to add a keyword
parameter lazy which call's {{{LazyFamily}}}. The parameter is False by
for now default. I think it depends on the input. In particular if
{{{index}}} is a combinatorial class which is not a finite one, then the
former implementation turned lazy by default. Should we do that ?
Cheers,
Florent
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5538#comment:4>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---