Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Package rec_sequences

I installed rec_sequences.

I repeat the proposed example: from rec_sequences.CFiniteSequenceRing import * from rec_sequences.C2FiniteSequenceRing import * No problem.

However, in response to C = CFiniteSequenceRing(QQ) error message: TypeError: __init__() takes at least 1 positional argument (0 given)

Can you please tell me what the problem is?

Package rec_sequences

I installed rec_sequences.

I repeat the proposed example: example:

from rec_sequences.CFiniteSequenceRing import * *

from rec_sequences.C2FiniteSequenceRing import * *

No problem.

However, in response to C = CFiniteSequenceRing(QQ) error message: TypeError: __init__() takes at least 1 positional argument (0 given)

Can you please tell me what the problem is?

Package rec_sequences

I installed rec_sequences.

I repeat the proposed example:

from rec_sequences.CFiniteSequenceRing import *

from rec_sequences.C2FiniteSequenceRing import *

No problem.

However, in response to C = CFiniteSequenceRing(QQ) error message: TypeError: __init__() takes at least 1 positional argument (0 given)

KeyError                                  Traceback (most recent call last)                                             File ~/sage/sage/src/sage/misc/cachefunc.pyx:1007, in sage.misc.cachefunc.CachedFunction.__call__()                        1006 try:                                                                                                            -> 1007     return self.cache[k]                                                                                           1008 except TypeError:  # k is not hashable                                                                                                                                                                                                  File ~/sage/sage/src/sage/misc/weak_dict.pyx:715, in sage.misc.weak_dict.WeakValueDictionary.__getitem__()                  714 if wr == NULL:                                                                                                  --> 715     raise KeyError(k)                                                                                               716 out = PyWeakref_GetObject(wr)                                                                                                                                                                                                           KeyError: ((<class 'rec_sequences.CFiniteSequenceRing.CFiniteSequenceRing'>, Rational Field), ())                                                                                                                                               During handling of the above exception, another exception occurred:                                                                                                                                                                             TypeError                                 Traceback (most recent call last)                                             Cell In[3], line 1                                                                                                      ----> 1 C = CFiniteSequenceRing(QQ)                                                                                                                                                                                                             File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:320, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__()                                                                                                                          318 """                                                                                                                 319 if cls.classcall is not None:                                                                                   --> 320     return cls.classcall(cls, *args, **kwds)                                                                        321 else:                                                                                                               322     # Fast version of type.__call__(cls, *args, **kwds)                                                                                                                                                                                 File ~/sage/sage/src/sage/misc/cachefunc.pyx:1012, in sage.misc.cachefunc.CachedFunction.__call__()                        1010         return self.cache[k]                                                                                       1011 except KeyError:                                                                                                -> 1012     w = self.f(*args, **kwds)                                                                                      1013     self.cache[k] = w                                                                                              1014     return w                                                                                                                                                                                                                            File ~/sage/sage/src/sage/structure/unique_representation.py:1010, in CachedRepresentation.__classcall__(cls, *args, **options)                                                                                                                     995 @weak_cached_function(cache=128)  # automatically a staticmethod                                                    996 def __classcall__(cls, *args, **options):                                                                           997     """                                                                                                             998     Construct a new object of this class or reuse an existing one.                                                  999                                                                                                                    (...)                                                                                                                   1008         True                                                                                                       1009     """                                                                                                         -> 1010     instance = typecall(cls, *args, **options)                                                                     1011     assert isinstance(instance, cls)                                                                               1012     if instance.__class__.__reduce__ == CachedRepresentation.__reduce__:                                                                                                                                                                File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:471, in sage.misc.classcall_metaclass.typecall()                     469     2                                                                                                               470 """                                                                                                             --> 471 return (<PyTypeObject*>type).tp_call(cls, args, kwds)                                                               472                                                                                                                     473                                                                                                                                                                                                                                         File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/CFiniteSequenceRing.py:2218, in CFiniteSequenceRing.__init__(self, field, time_limit, name, element_class, category)                              2214 # self._dom_root_table is used to save already computed results                                                    2215 # about which characteristic polynomials have a unique dominant root                                               2216 self._dom_root_table = dict()                                                                                   -> 2218 DFiniteSequenceRing.__init__(self, self._poly_ring, time_limit)                                                                                                                                                                         File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/DFiniteSequenceRing.py:1608, in DFiniteSequenceRing.__init__(self, ring, time_limit, name, element_class, category)                               1605 self._var_ore_algebra = self._ore_algebra.variable_name()                                                          1606 field = self._ore_algebra.base_ring().base_ring()                                                               -> 1608 RecurrenceSequenceRing.__init__(self, field)                                                                                                                                                                                            File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/RecurrenceSequenceRing.py:546, in RecurrenceSequenceRing.__init__(self, field, name, element_class, category)                                      541     raise TypeError("Recurrence sequences need to be defined "                                                      542                     "over a field")                                                                                 544 self._base_ring = field                                                                                         --> 546 CommutativeAlgebra.__init__(self, field,                                                                            547                             category=CommutativeAlgebras(field))                                                                                                                                                                        File ~/sage/sage/src/sage/rings/ring.pyx:1836, in sage.rings.ring.CommutativeAlgebra.__init__()                            1834 def __init__(self, base_ring, *args, **kwds):                                                                      1835     deprecation(37999, "use the category CommutativeAlgebras")                                                  -> 1836     super().__init__(*args, **kwds)                                                                                1837                                                                                                                    1838                                                                                                                                                                                                                                         File ~/sage/sage/src/sage/rings/ring.pyx:1029, in sage.rings.ring.CommutativeRing.__init__()                               1027 _default_category = _CommutativeRings                                                                              1028                                                                                                                 -> 1029 def __init__(self, base_ring, names=None, normalize=True, category=None):                                          1030     """                                                                                                            1031     Initialize ``self``.                                                                                                                                                                                                                TypeError: __init__() takes at least 1 positional argument (0 given)

Can you please tell me what the problem is?

Package rec_sequences

I installed rec_sequences.

I repeat the proposed example:

from rec_sequences.CFiniteSequenceRing import *

from rec_sequences.C2FiniteSequenceRing import *

No problem.

However, in response to C = CFiniteSequenceRing(QQ) error message: TypeError: __init__() takes at least 1 positional argument (0 given)

KeyError                                  Traceback (most recent call last)                                             last)

File ~/sage/sage/src/sage/misc/cachefunc.pyx:1007, in sage.misc.cachefunc.CachedFunction.__call__() sage.misc.cachefunc.CachedFunction.__call__() 1006 try: try: -> 1007 return self.cache[k] self.cache[k] 1008 except TypeError: # k is not hashable hashable

File ~/sage/sage/src/sage/misc/weak_dict.pyx:715, in sage.misc.weak_dict.WeakValueDictionary.__getitem__() sage.misc.weak_dict.WeakValueDictionary.__getitem__() 714 if wr == NULL: NULL: --> 715 raise KeyError(k) KeyError(k) 716 out = PyWeakref_GetObject(wr) PyWeakref_GetObject(wr)

KeyError: ((<class 'rec_sequences.CFiniteSequenceRing.CFiniteSequenceRing'>, 'rec_sequences.cfinitesequencering.cfinitesequencering'="">, Rational Field), ()) ())

During handling of the above exception, another exception occurred: occurred:

TypeError Traceback (most recent call last) last) Cell In[3], line 1 1 ----> 1 C = CFiniteSequenceRing(QQ) CFiniteSequenceRing(QQ)

File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:320, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__() sage.misc.classcall_metaclass.ClasscallMetaclass.__call__() 318 """ """ 319 if cls.classcall is not None: None: --> 320 return cls.classcall(cls, *args, **kwds) args, *kwds) 321 else: else: 322 # Fast version of type.__call__(cls, *args, **kwds) args, *kwds)

File ~/sage/sage/src/sage/misc/cachefunc.pyx:1012, in sage.misc.cachefunc.CachedFunction.__call__() sage.misc.cachefunc.CachedFunction.__call__() 1010 return self.cache[k] self.cache[k] 1011 except KeyError: KeyError: -> 1012 w = self.f(*args, **kwds) self.f(args, *kwds) 1013 self.cache[k] = w w 1014 return w w

File ~/sage/sage/src/sage/structure/unique_representation.py:1010, in CachedRepresentation.__classcall__(cls, *args, **options) args, *options) 995 @weak_cached_function(cache=128) # automatically a staticmethod staticmethod 996 def __classcall__(cls, *args, **options): args, *options): 997 """ """ 998 Construct a new object of this class or reuse an existing one. 999 (...) one. 999 (...) 1008 True True 1009 """ """ -> 1010 instance = typecall(cls, *args, **options) args, *options) 1011 assert isinstance(instance, cls) cls) 1012 if instance.__class__.__reduce__ == CachedRepresentation.__reduce__: CachedRepresentation.__reduce__:

File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:471, in sage.misc.classcall_metaclass.typecall() sage.misc.classcall_metaclass.typecall() 469 2 2 470 """ """ --> 471 return (<PyTypeObject*>type).tp_call(cls, (<pytypeobject*>type).tp_call(cls, args, kwds) 472 473 kwds) 472 473

File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/CFiniteSequenceRing.py:2218, in CFiniteSequenceRing.__init__(self, field, time_limit, name, element_class, category) category) 2214 # self._dom_root_table is used to save already computed results results 2215 # about which characteristic polynomials have a unique dominant root root 2216 self._dom_root_table = dict() dict() -> 2218 DFiniteSequenceRing.__init__(self, self._poly_ring, time_limit) time_limit)

File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/DFiniteSequenceRing.py:1608, in DFiniteSequenceRing.__init__(self, ring, time_limit, name, element_class, category) category) 1605 self._var_ore_algebra = self._ore_algebra.variable_name() self._ore_algebra.variable_name() 1606 field = self._ore_algebra.base_ring().base_ring() self._ore_algebra.base_ring().base_ring() -> 1608 RecurrenceSequenceRing.__init__(self, field) field)

File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/RecurrenceSequenceRing.py:546, in RecurrenceSequenceRing.__init__(self, field, name, element_class, category) category) 541 raise TypeError("Recurrence sequences need to be defined " " 542 "over a field") field") 544 self._base_ring = field field --> 546 CommutativeAlgebra.__init__(self, field, field, 547 category=CommutativeAlgebras(field)) category=CommutativeAlgebras(field))

File ~/sage/sage/src/sage/rings/ring.pyx:1836, in sage.rings.ring.CommutativeAlgebra.__init__() sage.rings.ring.CommutativeAlgebra.__init__() 1834 def __init__(self, base_ring, *args, **kwds): args, *kwds): 1835 deprecation(37999, "use the category CommutativeAlgebras") CommutativeAlgebras") -> 1836 super().__init__(*args, **kwds) 1837 1838 super().__init__(args, *kwds) 1837 1838

File ~/sage/sage/src/sage/rings/ring.pyx:1029, in sage.rings.ring.CommutativeRing.__init__() sage.rings.ring.CommutativeRing.__init__() 1027 _default_category = _CommutativeRings 1028 _CommutativeRings 1028 -> 1029 def __init__(self, base_ring, names=None, normalize=True, category=None): category=None): 1030 """ """ 1031 Initialize ``self``. self.

TypeError: __init__() takes at least 1 positional argument (0 given) given)

Can you please tell me what the problem is?

Package rec_sequences

I installed rec_sequences.

I repeat the proposed example:

from rec_sequences.CFiniteSequenceRing import *

from rec_sequences.C2FiniteSequenceRing import *

No problem.

However, in response to C = CFiniteSequenceRing(QQ) error message: TypeError: __init__() takes at least 1 positional argument (0 given)

KeyError                                  Traceback (most recent call last)

last) File ~/sage/sage/src/sage/misc/cachefunc.pyx:1007, in sage.misc.cachefunc.CachedFunction.__call__() sage.misc.cachefunc.CachedFunction.__call__() 1006 try: try: -> 1007 return self.cache[k] self.cache[k] 1008 except TypeError: # k is not hashable

hashable File ~/sage/sage/src/sage/misc/weak_dict.pyx:715, in sage.misc.weak_dict.WeakValueDictionary.__getitem__() sage.misc.weak_dict.WeakValueDictionary.__getitem__() 714 if wr == NULL: NULL: --> 715 raise KeyError(k) KeyError(k) 716 out = PyWeakref_GetObject(wr)

PyWeakref_GetObject(wr) KeyError: ((<class 'rec_sequences.cfinitesequencering.cfinitesequencering'="">, 'rec_sequences.CFiniteSequenceRing.CFiniteSequenceRing'>, Rational Field), ())

()) During handling of the above exception, another exception occurred:

occurred: TypeError Traceback (most recent call last) last) Cell In[3], line 1 1 ----> 1 C = CFiniteSequenceRing(QQ)

CFiniteSequenceRing(QQ) File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:320, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__() sage.misc.classcall_metaclass.ClasscallMetaclass.__call__() 318 """ """ 319 if cls.classcall is not None: None: --> 320 return cls.classcall(cls, args, *kwds) *args, **kwds) 321 else: else: 322 # Fast version of type.__call__(cls, args, *kwds)

*args, **kwds) File ~/sage/sage/src/sage/misc/cachefunc.pyx:1012, in sage.misc.cachefunc.CachedFunction.__call__() sage.misc.cachefunc.CachedFunction.__call__() 1010 return self.cache[k] self.cache[k] 1011 except KeyError: KeyError: -> 1012 w = self.f(args, *kwds) self.f(*args, **kwds) 1013 self.cache[k] = w w 1014 return w

w File ~/sage/sage/src/sage/structure/unique_representation.py:1010, in CachedRepresentation.__classcall__(cls, args, *options) *args, **options) 995 @weak_cached_function(cache=128) # automatically a staticmethod staticmethod 996 def __classcall__(cls, args, *options): *args, **options): 997 """ """ 998 Construct a new object of this class or reuse an existing one. 999 (...) one. 999 (...) 1008 True True 1009 """ """ -> 1010 instance = typecall(cls, args, *options) *args, **options) 1011 assert isinstance(instance, cls) cls) 1012 if instance.__class__.__reduce__ == CachedRepresentation.__reduce__:

CachedRepresentation.__reduce__: File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:471, in sage.misc.classcall_metaclass.typecall() sage.misc.classcall_metaclass.typecall() 469 2 2 470 """ """ --> 471 return (<pytypeobject*>type).tp_call(cls, (<PyTypeObject*>type).tp_call(cls, args, kwds) 472 473

kwds) 472 473 File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/CFiniteSequenceRing.py:2218, in CFiniteSequenceRing.__init__(self, field, time_limit, name, element_class, category) category) 2214 # self._dom_root_table is used to save already computed results results 2215 # about which characteristic polynomials have a unique dominant root root 2216 self._dom_root_table = dict() dict() -> 2218 DFiniteSequenceRing.__init__(self, self._poly_ring, time_limit)

time_limit) File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/DFiniteSequenceRing.py:1608, in DFiniteSequenceRing.__init__(self, ring, time_limit, name, element_class, category) category) 1605 self._var_ore_algebra = self._ore_algebra.variable_name() self._ore_algebra.variable_name() 1606 field = self._ore_algebra.base_ring().base_ring() self._ore_algebra.base_ring().base_ring() -> 1608 RecurrenceSequenceRing.__init__(self, field)

field) File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/RecurrenceSequenceRing.py:546, in RecurrenceSequenceRing.__init__(self, field, name, element_class, category) category) 541 raise TypeError("Recurrence sequences need to be defined " " 542 "over a field") field") 544 self._base_ring = field field --> 546 CommutativeAlgebra.__init__(self, field, field, 547 category=CommutativeAlgebras(field))

category=CommutativeAlgebras(field)) File ~/sage/sage/src/sage/rings/ring.pyx:1836, in sage.rings.ring.CommutativeAlgebra.__init__() sage.rings.ring.CommutativeAlgebra.__init__() 1834 def __init__(self, base_ring, args, *kwds): *args, **kwds): 1835 deprecation(37999, "use the category CommutativeAlgebras") CommutativeAlgebras") -> 1836 super().__init__(args, *kwds) 1837 1838

super().__init__(*args, **kwds) 1837 1838 File ~/sage/sage/src/sage/rings/ring.pyx:1029, in sage.rings.ring.CommutativeRing.__init__() sage.rings.ring.CommutativeRing.__init__() 1027 _default_category = _CommutativeRings 1028 _CommutativeRings 1028 -> 1029 def __init__(self, base_ring, names=None, normalize=True, category=None): category=None): 1030 """ """ 1031 Initialize self.

``self``. TypeError: __init__() takes at least 1 positional argument (0 given)

given)

Can you please tell me what the problem is?

click to hide/show revision 6
None

Package rec_sequences

I installed rec_sequences.rec_sequences (https://github.com/PhilippNuspl/rec_sequences)

I repeat the proposed example:

from rec_sequences.CFiniteSequenceRing import *

*

from rec_sequences.C2FiniteSequenceRing import *

*

No problem.

However, in response to C = CFiniteSequenceRing(QQ) error message: TypeError: __init__() takes at least 1 positional argument (0 given)

KeyError                                  Traceback (most recent call last)                                             File ~/sage/sage/src/sage/misc/cachefunc.pyx:1007, in sage.misc.cachefunc.CachedFunction.__call__()                        1006 try:                                                                                                            -> 1007     return self.cache[k]                                                                                           1008 except TypeError:  # k is not hashable                                                                                                                                                                                                  File ~/sage/sage/src/sage/misc/weak_dict.pyx:715, in sage.misc.weak_dict.WeakValueDictionary.__getitem__()                  714 if wr == NULL:                                                                                                  --> 715     raise KeyError(k)                                                                                               716 out = PyWeakref_GetObject(wr)                                                                                                                                                                                                           KeyError: ((<class 'rec_sequences.CFiniteSequenceRing.CFiniteSequenceRing'>, Rational Field), ())                                                                                                                                               During handling of the above exception, another exception occurred:                                                                                                                                                                             TypeError                                 Traceback (most recent call last)                                             Cell In[3], line 1                                                                                                      ----> 1 C = CFiniteSequenceRing(QQ)                                                                                                                                                                                                             File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:320, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__()                                                                                                                          318 """                                                                                                                 319 if cls.classcall is not None:                                                                                   --> 320     return cls.classcall(cls, *args, **kwds)                                                                        321 else:                                                                                                               322     # Fast version of type.__call__(cls, *args, **kwds)                                                                                                                                                                                 File ~/sage/sage/src/sage/misc/cachefunc.pyx:1012, in sage.misc.cachefunc.CachedFunction.__call__()                        1010         return self.cache[k]                                                                                       1011 except KeyError:                                                                                                -> 1012     w = self.f(*args, **kwds)                                                                                      1013     self.cache[k] = w                                                                                              1014     return w                                                                                                                                                                                                                            File ~/sage/sage/src/sage/structure/unique_representation.py:1010, in CachedRepresentation.__classcall__(cls, *args, **options)                                                                                                                     995 @weak_cached_function(cache=128)  # automatically a staticmethod                                                    996 def __classcall__(cls, *args, **options):                                                                           997     """                                                                                                             998     Construct a new object of this class or reuse an existing one.                                                  999                                                                                                                    (...)                                                                                                                   1008         True                                                                                                       1009     """                                                                                                         -> 1010     instance = typecall(cls, *args, **options)                                                                     1011     assert isinstance(instance, cls)                                                                               1012     if instance.__class__.__reduce__ == CachedRepresentation.__reduce__:                                                                                                                                                                File ~/sage/sage/src/sage/misc/classcall_metaclass.pyx:471, in sage.misc.classcall_metaclass.typecall()                     469     2                                                                                                               470 """                                                                                                             --> 471 return (<PyTypeObject*>type).tp_call(cls, args, kwds)                                                               472                                                                                                                     473                                                                                                                                                                                                                                         File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/CFiniteSequenceRing.py:2218, in CFiniteSequenceRing.__init__(self, field, time_limit, name, element_class, category)                              2214 # self._dom_root_table is used to save already computed results                                                    2215 # about which characteristic polynomials have a unique dominant root                                               2216 self._dom_root_table = dict()                                                                                   -> 2218 DFiniteSequenceRing.__init__(self, self._poly_ring, time_limit)                                                                                                                                                                         File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/DFiniteSequenceRing.py:1608, in DFiniteSequenceRing.__init__(self, ring, time_limit, name, element_class, category)                               1605 self._var_ore_algebra = self._ore_algebra.variable_name()                                                          1606 field = self._ore_algebra.base_ring().base_ring()                                                               -> 1608 RecurrenceSequenceRing.__init__(self, field)                                                                                                                                                                                            File ~/sage/sage/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/rec_sequences/RecurrenceSequenceRing.py:546, in RecurrenceSequenceRing.__init__(self, field, name, element_class, category)                                      541     raise TypeError("Recurrence sequences need to be defined "                                                      542                     "over a field")                                                                                 544 self._base_ring = field                                                                                         --> 546 CommutativeAlgebra.__init__(self, field,                                                                            547                             category=CommutativeAlgebras(field))                                                                                                                                                                        File ~/sage/sage/src/sage/rings/ring.pyx:1836, in sage.rings.ring.CommutativeAlgebra.__init__()                            1834 def __init__(self, base_ring, *args, **kwds):                                                                      1835     deprecation(37999, "use the category CommutativeAlgebras")                                                  -> 1836     super().__init__(*args, **kwds)                                                                                1837                                                                                                                    1838                                                                                                                                                                                                                                         File ~/sage/sage/src/sage/rings/ring.pyx:1029, in sage.rings.ring.CommutativeRing.__init__()                               1027 _default_category = _CommutativeRings                                                                              1028                                                                                                                 -> 1029 def __init__(self, base_ring, names=None, normalize=True, category=None):                                          1030     """                                                                                                            1031     Initialize ``self``.                                                                                                                                                                                                                TypeError: __init__() takes at least 1 positional argument (0 given)

Can you please tell me what the problem is?