Hi Christian, > I already asked this, but no one seemed to have an opinion on that... > > I have now implemented 5 or 6 bijections between Dyck paths and > subsets of permutations (pattern-avoiding or noncrossing). I think > that it is not practical to have a name for each of them since they 1. > do not necessarily have names in the literature and 2. the list of > methods for Dyck paths (and actually many other objects) becomes more > and more confusing in tab completion which I find not very user > friendly. > > I currently have > > DyckWord.to_permutation(bijection=None) > > and then the optional argument bijection is used to differ between the > bijections. But another solution would actually be to have > > sage: d = DyckWord([]) > sage: d.to_permutation.<tab> > > yields a list of all possible maps > > and even more > > sage: d.statistics.<tab> > > yields a list of all combinatorial statistics (Anne actually requested > such a use case some time ago). Using this behavior would make the > statistics not appear directly when typing > > sage: d.<tab> > > Only statistics would appear here. The same maybe for maps, then we > would not have > > sage: d.to_permutation.<tab> > > but > > sage: d.maps.<tab> > > would give a list of maps and > > sage: d.maps.to_permutation.<tab> > > then the list of maps to permutations. This way, we would have a > better organization of the combinatorial maps and statistics (which > would be very helpful, I guess, if we keep implementing more and more > of these), and the tab completion becomes arranged in a user readable > way. > > a. what do you think about such a design?
I think such a design is a good idea. I am not completely sure whether d.maps.to_permutation.<tab> is really needed. Perhaps d.to_permutation.<tab> is enough. > b. it seems to be not standard in object-oriented programming. what > are the down-sides? > > c. i would have no idea how to reach such an implementation. I think a similar implementation was recently done for symmetric functions, by doing sage: Sym = SymmetricFunctions(QQ['q','t']) sage: Mac = Sym.macdonald() sage: Ht = Mac.Ht() so you can probably look in /combinat/sf/ (with the new symmetric function patch applied) to see how it is done. Best, Anne -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.