Vincent I had read your post but I hadn't understood that you wanted something like this. This Map class seems a really good idea to me, it looks like our combinatorial map class that we use to wrap the methods but improved.
After this discussion, the way I would see things would be: * having a permanent database into sage containing the maps * calling the database from the object to get create the map objects and access the information * using the decorator to add those maps in the database A few questions: - how do I use the decorator to add the maps in the database, won't it cost time to check the database when I create the object? - Where should we put the "combinatorial_maps" method to actually get the list of maps on a given object (or parent) 2014-05-28 11:54 GMT+02:00 Vincent Delecroix <20100.delecr...@gmail.com>: > Hi Christian, > > 2014-05-28 11:32 UTC+02:00, Christian Stump <christian.st...@gmail.com>: > >> It seems that actually nobody read my initial post on that thread... so > >> let me repeat > > > > I did -- but didn't really have any qualified contribution... > > > >> But the semantic has to be implemented at the level of maps not at the > >> level of methods. > > > > could you explain what you mean there (maybe using your example of the > > number of descents of a permutation). > > A method ( = a Python function) is not a Sage Map ( = a Python object > that model a mathematical function). I would like first to convert the > method into a map > {{{ > from sage.categories.map import Map > class NumberOfDescents(Map): > def __init__(self): > Map.__init__(Permutations(), NonNegativeIntegers()) > > def _call_(self, p): > return Integer(p.number_of_descents()) > }}} > The above example is already non-trivial since it specifies a domain > and a codomain (which is different from the parent of the image of an > element): > {{{ > sage: nod = NumberOfDescents() > sage: p = Permutation([3,2,1]) > sage: nod(p) > 3 > sage: nod(p).parent() is NN > False > }}} > The second step would be to think how to add semantic to the map. Part > of is already managed by the axioms/categories (for example a Morphism > between GradedSets preserve the grading). But there is nothing for > injectivity/surjectivity or more subtle properties. > > It would make more sense to register actual maps as above. > > Vincent > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.