#15567: Fix Alphabet and improvements to Family
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: sage-combinat
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.1
Component: combinatorics | Resolution:
Keywords: alphabet | Merged in:
Authors: Travis Scrimshaw | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/combinat/words/fix_alphabet | b3396dd62e96a08621cf08a6b2573c59a664adac
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by ncohen):
* status: needs_review => needs_work
Comment:
Hello !
I don't know how this "names" argument is used at all, but its current
behaviour is the following :
{{{
sage: build_alphabet(oo,'x')[4]
'x4'
sage: build_alphabet(range(40),'x')[4]
4
}}}
Which is not very consistent. While playing with it I found something else
which totally scares me :
{{{
sage: build_alphabet(oo,'x')
Lazy family (x(i))_{i in Non negative integers}
sage: build_alphabet(oo,'x')[:4]
'xslice(None, 4, None)'
sage: print list(build_alphabet(oo,'x')[:4])
['x', 's', 'l', 'i', 'c', 'e', '(', 'N', 'o', 'n', 'e', ',', ' ', '4',
',', ' ', 'N', 'o', 'n', 'e', ')']
}}}
While I expected to get the list of the first 4 elements. And I really do
not know what to make with that `O_o`
Anyway, I think that the `build_alphabet` function could use a "INPUT"
section explaining its parameters, and in particular the "names" field.
Which, in the context of `build_alphabet(oo,'x')` would be better renamed
to "prefix", as it adds this string to all members of the family.
It would be nice to say what exactlyl this function is supposed to return.
About the modifications to `Family` :
* would it be possible to add to the documentation of "hidden_keys" an
explanation of what exactly it does ? Does it mean that the hidden keys
are "skipped", i.e. removed from "indices" ?
* the explanation of what `hidden_function` is isn't very clear either
`O_o`
The fact that the "name" argument does nothing for finite lists should be
made clear I guess. I mean, what is it useful for exactly ? Lazy Families
only ?
{{{
sage: Family([0,0,0],function=lambda x:x,name="e")
Finite family {0: 0}
}}}
By the way, perhaps there should be in Sage something called "named
function" somewhere `:-)`
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/15567#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.