#11935: Make parent/element classes independent of base rings
----------------------------------------------------------+-----------------
Reporter: SimonKing | Owner:
Type: enhancement | Status:
needs_review
Priority: major | Milestone:
sage-5.10
Component: categories | Resolution:
Keywords: parent class, element class, category | Work issues:
Report Upstream: N/A | Reviewers:
Nicolas Thiery, Travis Scrimshaw
Authors: Simon King | Merged in:
Dependencies: #9138, #11900, #11943, #12875, #12877 | Stopgaps:
----------------------------------------------------------+-----------------
Changes (by tscrim):
* reviewer: => Nicolas Thiery, Travis Scrimshaw
Old description:
> At #11900 and [http://groups.google.com/group/sage-combinat-
> devel/browse_thread/thread/99c74827d704e677 sage-combinat-devel], as well
> as in some comments in sage/categories/category.py, the idea was
> discussed to make, for example,
> `Algebras(GF(3)).parent_class==Algebras(GF(5)).parent_class` - hence,
> make the parent/element classes as independent from the base of a
> category as possible.
>
> This is implemented in this patch by introducing an abstract class
> CategoryWithParameters which uses pickling by "weak construction" for
> its element and parent classes. Now:
>
> - For a join category, the parent/element class depend only on the
> parent/element class of its super categories.
> - For a Category_over_base (e.g. Modules, Algebras, Schemes, ...), the
> parent/element class depend only on the category of the base.
> - For a bimodule, the parent/element class depend only on the category
> of the left and right bases.
>
> In the process, this patch also:
>
> - Adds a method Category._make_named_class providing a unified way to
> create parent and element classes (and later on morphism classes)
> - Extends the interface of dynamic_class to customize caching and
> pickling
> - Rename the experimental class IdempotentSemigroups.ElementMethods
> and remove its super class, and discards unused code there.
>
> __Apply__
>
> * [attachment:trac11935_weak_pickling_by_construction-nt.patch]
New description:
At #11900 and [http://groups.google.com/group/sage-combinat-
devel/browse_thread/thread/99c74827d704e677 sage-combinat-devel], as well
as in some comments in sage/categories/category.py, the idea was discussed
to make, for example,
`Algebras(GF(3)).parent_class==Algebras(GF(5)).parent_class` - hence, make
the parent/element classes as independent from the base of a category as
possible.
This is implemented in this patch by introducing an abstract class
CategoryWithParameters which uses pickling by "weak construction" for
its element and parent classes. Now:
- For a join category, the parent/element class depend only on the
parent/element class of its super categories.
- For a Category_over_base (e.g. Modules, Algebras, Schemes, ...), the
parent/element class depend only on the category of the base.
- For a bimodule, the parent/element class depend only on the category
of the left and right bases.
In the process, this patch also:
- Adds a method Category._make_named_class providing a unified way to
create parent and element classes (and later on morphism classes)
- Extends the interface of dynamic_class to customize caching and pickling
- Rename the experimental class IdempotentSemigroups.ElementMethods
and remove its super class, and discards unused code there.
__Apply__
* [attachment:trac11935_weak_pickling_by_construction-nt.patch]
* [attachment:trac_11935-weak_pickling_by_construction-review-ts.patch]
--
Comment:
Hey Nicolas and Simon,
I've looked over the documentation. I've uploaded a small review patch
(also to to the combinat queue) which makes some minor tweaks to the doc
and adds a few more tests to `CategoryWithParameters._make_named_class()`.
If you're happy with my changes, then you can set this to positive review.
Best,[[BR]]
Travis
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11935#comment:83>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.