[sage-devel] Re: Parent structure class hierarchy

2016-08-07 Thread Joseph Hundley
I realized that this question is a bit unclear as it links to a URL with a lot of stuff on it, but all I had in mind was the part with heading The Abstract Element Class Hierarchy. This is just a list of all the pre-existing element classes which was very handy for figuring out what's there al

[sage-devel] Re: Parent structure class hierarchy

2016-08-07 Thread Joseph Hundley
Hi Simon, Thanks for your reply. I think I see the source of my confusion. Best, Joe On Saturday, August 6, 2016 at 4:31:37 PM UTC-4, Simon King wrote: > > Hi John, > > On 2016-08-06, Joseph Hundley > wrote: > > I remark that maybe when someone qualified has some time it would be > worth >

[sage-devel] Re: Parent structure class hierarchy

2016-08-07 Thread Eric Gourgoulhon
Hi Joseph, For what it's forth, I may tell what is done in SageManifolds (metaticket #18528 ): SageManifolds involves many parent classes. All of them are implemented as direct subclasses of Parent. Their algebraic structures (group, free module, non-free

[sage-devel] Re: Parent structure class hierarchy

2016-08-06 Thread Simon King
Hi John, On 2016-08-06, Joseph Hundley wrote: > I remark that maybe when someone qualified has some time it would be worth > updating Simon's > how-to > at > http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html#base-classes. > > This bit appears (to me, anyway) to r

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Joseph Hundley
Thanks for the advice and the link to the updated element class hierarchy. If I understand correctly, the consensus is that it's not worth my time fussing over which parent class to use and I might as well just use Parent, and it's *maybe* still worth my time fussing over which element class

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Simon King
Hi Jeroen, On 2016-08-05, Jeroen Demeyer wrote: > Pointers are welcome. #18756: It makes it possible for a category to define a coerce action for its objects, providing a multiplication/addition/... for the elements of the objects. A coerce action can be implemented in Cython and can use cythone

Re: [sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Jeroen Demeyer
On 2016-08-05 21:15, Simon King wrote: By the way, concerning element classes, if I recall correctly from your previous posts, you are working on unification of the Element class hierarchy Yes. See #20767 I also have a couple of tickets dedicated to that (for example, making it easier to impl

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Simon King
Hi Jeroen, On 2016-08-05, Jeroen Demeyer wrote: > There are parent classes like Ring, Field, ... They are defined in > various files, for example in src/sage/rings/ring.pyx > > However, it is not really clear how they should be used, especially > because there is a lot of overlap with categorie

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Simon King
Hi Travis, On 2016-08-05, Travis Scrimshaw wrote: > On Friday, August 5, 2016 at 10:11:13 AM UTC-5, Andrew wrote: > It is not true that CFM is implemented in Python. The addition and scalar > coefficient action are done in cython in dict_addition. See > https://trac.sagemath.org/ticket/20680, a

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Travis Scrimshaw
On Friday, August 5, 2016 at 10:11:13 AM UTC-5, Andrew wrote: > > > > On Friday, 5 August 2016 18:23:03 UTC+10, Simon King wrote: > >> So, my advice is: >> - Start with one of the element base classes and implement arithmetics >> there (and be careful to comply with Sage's coercion model). >

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Andrew
On Friday, 5 August 2016 18:23:03 UTC+10, Simon King wrote: > So, my advice is: > - Start with one of the element base classes and implement arithmetics > there (and be careful to comply with Sage's coercion model). > - Use the category framework to determine whether a parent it is a (say)

Re: [sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Jeroen Demeyer
On 2016-08-05 10:22, Simon King wrote: I believe there should *not* be a hierarchy of parent base classes similar to the element classes. I believe that there should *not* be such a hierarchy of Element classes either. Ticket #20767 already removes many of the differences between those Elemen

[sage-devel] Re: Parent structure class hierarchy

2016-08-05 Thread Simon King
Hi Joseph, On 2016-08-05, Travis Scrimshaw wrote: > Hey Joseph, >It is basically just Parent. I don't know of any other ABC that is a > subclass of Parent. Although a common concrete implementation of Parent > that is often used as a base class (for algebras) is > CombinatorialFreeModule.

[sage-devel] Re: Parent structure class hierarchy

2016-08-04 Thread Travis Scrimshaw
Hey Joseph, It is basically just Parent. I don't know of any other ABC that is a subclass of Parent. Although a common concrete implementation of Parent that is often used as a base class (for algebras) is CombinatorialFreeModule. Best, Travis PS - a more up-to-date version is http://doc.s