-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleaning CategoryObject/Parent #21380
Comments
comment:1
Are you sure this would affect |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Replying to @videlec:
After thinking about this now and then, I think that it does make sense to keep |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:21
What is wrong with the functions |
comment:22
Replying to @jdemeyer:
Some does, some does not and there is no specification of what a base is. I would be happy to hear a definition. |
comment:23
Replying to @jdemeyer:
Right (I made the listing rather quickly) |
comment:24
Replying to @videlec:
Well, we cannot define "base" in full generality. Some objects do not have a natural base and then this attribute should simply be But in certain important categories, we can define "base". For example, for modules, we define "base" to mean the parent of the scalars used for scalar multiplication. |
comment:25
Replying to @jdemeyer:
This is precisely the reason why I dislike it. It is a fake global concept that is mostly meant for "the underlying ring of a module". And because modules are important all parents have an attribute Moreover, I (maybe wrongly) thought that this "base ring of a module" is the kind of information that belongs to the category
|
comment:39
Replying to @videlec:
You could make |
comment:40
Replying to @tscrim:
I don't think that it makes much sense to have unrelated classes
Thanks for the reminder. Getting rid of those old-style parents should probably be higher priority than this ticket. |
comment:41
Replying to @jdemeyer:
Ideally it should be a diamond IMO, but Cython does not (yet?) support multiple inheritance (or something like interfaces in Java-speak).
We have objects with base but without gens (e.g., polytopes), objects without base but with gens (e.g., permutation groups), as well as with(out) both. So I was trying to address that with my proposed hierarchy. At least I would like Although I'm a little worried with the group class hierarchy becoming a bit more of a mess because of the Cython parents and not having the multiple inheritance. Might be a necessary complication in order to improve the interface (which IMO is net benefit). Spreading out to a more refined parent hierarchy is going to be a fairly invasive change, so I guess it will just have to be done.
Yes, definitely. Although most of them are really fundamental parents such as |
comment:42
Replying to @tscrim:
First of all, the next release of Cython is going to support multiple inheritance in a limited way. The list of bases can be Second, the fact that diamonds are not allowed is because of Python's design. In plain Python, you cannot do Anyway, the conclusion is that |
comment:43
Replying to @tscrim:
The large majority of rings use the new coercion model, so it's not as bad as you think. |
comment:44
Replying to @jdemeyer:
That's good to hear and should be useful here.
Sorry, I guess I was thinking a little too loosely with not distinguishing between classes and (builtin) types.
I think this would be the most sensible solution since most of our Cython parent classes would inherit from the |
comment:45
Replying to @jdemeyer:
That's good to hear. Now if only I could find some time to work on this directly... |
This comment has been minimized.
This comment has been minimized.
comment:48
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
Abstract
This ticket stands to clean
CategoryObject
andParent
with respect to:base
or_ngens_
)sage.structure.generators
)_an_element_
andan_element
)Subtasks
Base and generators
We should move out of
CategoryObject
the attributes and methods related to generators and variable names.Attributes:
_names
Methods:
gens_dict
gens_dict_recursive
objgens
objgen
_first_ngens
_defining_names
_assign_names
__temporarily_change_names
variable_names
variable_name
latex_variable_names
latex_name
inject_variables
base_ring
It is not clear where all this should be moved... Moreover "generators" is ambiguous since "monoid generators", "group generators", "algebra generators", ... are different things.
Keep
These were originally proposed to be removed too, but are sufficiently useful:
Attributes:
_base
Methods:
base
Functions:
normalize_names
certify_names
Tickets
Some related tickets are
gradual transition for to remove inheritance from
ParentWithGens
toRing
(New class for gradually transitioning parents with generators to the new coercion model #13683? still useful?)normalization:
variable
vsvariable_name
vsvariables
#24430: normalization for_names
,variable_name
andvariable_names
in the context of polynomials and seriesTransition to
FiniteEnumeratedSet
set the category to
FiniteEnumeratedSets
where appropriate (Categories for finite (enumerated) sets #12957)Move
__len__
and__getitem__
fromParent
toFiniteEnumeratedSets
(Move __len__ and __getitem__ from Parent to FiniteEnumeratedSets #12955)deprecate
CombinatorialClass
in favor of theEnumeratedSets
category (Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories #12913, make Combinations a new style Parent #19986)Duplicated names for same function
cleanup
an_element
(Cleanup an_element #18291)cardinality vs order (cardinality vs order #18410)
Others
move
Set_generic
andSet_Python_type_class
out ofsage.structure.parent
. Moreover we should useUniqueRepresentation
instead of the custom class factorySet_PythonType
.Various fixes in category initialization (fix
MIPVariable
inheritance #21353)cleanup variable factories (cleanup variable factories #18390)
cleanup cartesian products (task ticket Meta-ticket: Cleanup cartesian products #15425)
Closed tickets
refactor
getattr_from_other_class
(Refactor getattr_from_other_class() for lookup of methods in categories #20686)Simplify
_populate_generators_
(Simplify _populate_generators_ #21381)Remove
sage.structure.generators
(Remove sage.structure.generators #21382)Remove
ParentWith*AbelianGens
(Remove ParentWith*AbelianGens and Module_old #21383)Remove
_populate_generators_
(Remove support for Parent.__init__(gens=...) #21385)Always enable
debug.bad_parent_warnings
(Always enable debug.bad_parent_warnings #24109)CC: @tscrim
Component: categories
Issue created by migration from https://trac.sagemath.org/ticket/21380
The text was updated successfully, but these errors were encountered: