-
-
Notifications
You must be signed in to change notification settings - Fork 679
Description
At #11900 and 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
Depends on #9138
Depends on #11900
Depends on #11943
Depends on #12875
Depends on #12876
Depends on #12877
CC: @jdemeyer @sagetrac-sage-combinat
Component: categories
Keywords: parent class, element class
Author: Simon King
Reviewer: Nicolas M. Thiéry, Travis Scrimshaw
Merged: sage-5.11.beta1
Issue created by migration from https://trac.sagemath.org/ticket/11935