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
Make RecursivelyEnumeratedSet_forest a subclass of RecursivelyEnumeratedSet_generic #30238
Comments
Commit: |
Branch: u/slabbe/30238 |
comment:2
Note: I am changing the ordering of the input of the init method of This is transparent for the code based on the function |
comment:3
patchbot indicates doctest failures |
comment:4
ok, I will work on that. |
comment:6
I am changing the status to needs review just to see what the patchbot says. Locally, I still have at least the following issues, but I did not tested the whole library.
|
comment:7
I will need help to fix the above issue. Here is how to reproduce the error:
This is due to the fact that a Replacing the code based on the name of the class by diff --git a/src/sage/sets/recursively_enumerated_set.pyx b/src/sage/sets/recursively_enumerated_set.pyx
index 2ca2dde..b2f5455 100644
--- a/src/sage/sets/recursively_enumerated_set.pyx
+++ b/src/sage/sets/recursively_enumerated_set.pyx
@@ -539,6 +539,14 @@ cdef class RecursivelyEnumeratedSet_generic(Parent):
struct = 'forest'
elif classname.startswith('RecursivelyEnumeratedSet_generic'):
struct = None
+ # this creates the following error
+ # RecursionError: maximum recursion depth exceeded while calling a Python object
+ #elif hasattr(self, 'map_reduce'):
+ # struct = 'forest'
+ # this creates the following error
+ # RecursionError: maximum recursion depth exceeded while calling a Python object
+ #elif isinstance(self, RecursivelyEnumeratedSet_forest):
+ # struct = 'forest'
else:
A = isinstance(self, RecursivelyEnumeratedSet_generic)
raise TypeError("classname(={}) does not start with" I guess that code is based on |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
I updated The next step is to fix the following Recursion error which I still do not understand:
|
comment:10
It appears that the error comes from the reduction of the
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
Thank you Vincent. So, I managed to fix the Recursion error. Now, the same doctests fail for a different reason. I will work on that later. One feature of |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Replying to @seblabbe:
My guess is so that it pickles well when used to build other objects; e.g., as the basis for a |
comment:17
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:18
Setting a new milestone for this ticket based on a cursory review. |
As a follow up of #16351, we integrate the class
RecursivelyEnumeratedSet_forest
as a subclass ofRecursivelyEnumeratedSet_generic
implementing the following change:and consequential changes.
I was hoping this to be enough to activate few methods like
to_digraph
from the generic class that I like to use but are currently not available for the forest type. But unfortunately, the implementation of breadth first search for forest type does not yet take into account themax_depth
argument. That will be dealt in another ticket.CC: @tscrim
Component: combinatorics
Author: Sébastien Labbé
Branch/Commit: u/slabbe/30238 @
7b65a95
Issue created by migration from https://trac.sagemath.org/ticket/30238
The text was updated successfully, but these errors were encountered: