Hi Nathann,

On 2015-06-08, Nathann Cohen <[email protected]> wrote:
>> I disagree with that. There's some advantage: if your code only depends on
>> general mathematical properties of posets and not on the specific
>> implementation of the poset object, then it should be in the category.
>
> Absolutely no code in poset.py depends on the actual implementation.

Then why is it not moved to the parent and element classes of the
category of posets? Note that it is Python code anyway. Therefore the move
to sage.categories wouldn't make it slower. Just keep in mind that the
parent/element classes of a category are abstract base classes, i.e.,
one can't directly instanciate them. So, have a class definition of
posets in sage.poset, implement the "required" methods there, and let the
rest be inherited from Posets().

> Things will be fun when we will have two folders in Sage's src/
> directory, i.e. category/ and data_structures/

We do have these folders already. The latter being for (cythoned) data
structures that may be of general use (even outside of Sage). So, we
have
- general data structures in sage.data_structures,
- Sage specific *base* classes in sage.structure,
- stuff that isn't base class but is Sage specific in sage.misc (I wonder
  if that's a good place),
- (cythoned) implementations of a particular mathematical thing
  in folders such as sage.graphs or sage.matrix, and
- code that isn't just for a particular mathematical thing (e.g., matrix
  groups) but depends only on the mathematical structure and not on the
  implementation, and that doesn't need to be super-fast, in
  sage.categories.

The above is of course just a rule of thumb and I don't know if people
would agree with that rule. But I believe it is reasonable.

Best regards,
Simon


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to