Opened 11 years ago
Last modified 8 years ago
#12061 needs_work enhancement
Doctest interfaces/psage.py
Reported by: | Punarbasu Purkayastha | Owned by: | William Stein |
---|---|---|---|
Priority: | minor | Milestone: | sage-6.4 |
Component: | interfaces | Keywords: | doctest |
Cc: | Merged in: | ||
Authors: | Punarbasu Purkayastha | Reviewers: | |
Report Upstream: | N/A | Work issues: | find out why doctests change every sage version |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Attachments (4)
Change History (21)
Changed 11 years ago by
Attachment: | trac_12061-doctest_interfaces_psage.patch added |
---|
comment:1 Changed 11 years ago by
Form some reason doctesting this file goes into an infinite recursion with twisted, but all the commands work on the Sage command line. I had to run it like this to see the output .sage/tmp/psage_26566.py
is the file Sage created while trying to doctest.
PYTHONVERBOSE=1 ~/Installations/sage-4.7.2/sage -python psage_26566.py 2>&1 | tee ~/test.out
And ~/test.out
contains in particular this output just before the infinite recursion starts:
import sage.modules.vector_double_dense # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/modules/vector_double_dense.so dlopen("/home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/modules/vector_real_double_dense.so", 2); import sage.modules.vector_real_double_dense # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/modules/vector_real_double_dense.so import sage.finance.time_series # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/finance/time_series.so import sage.stats.intlist # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/stats/intlist.so # /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/plot3d/implicit_plot3d.pyc matches /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/plot3d/implicit_plot3d.py import sage.plot.plot3d.implicit_plot3d # precompiled from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/plot3d/implicit_plot3d.pyc dlopen("/home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/plot3d/implicit_surface.so", 2); import sage.plot.plot3d.implicit_surface # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/plot3d/implicit_surface.so dlopen("/home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/complex_plot.so", 2); import sage.plot.complex_plot # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/plot/complex_plot.so Exception IOError: IOError(2, 'No such file or directory') in <bound method SageElement.__del__ of <<currently executing code>>> ignored dlopen("/home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/libs/flint/flint.so", 2); import sage.libs.flint.flint # dynamically loaded from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/sage/libs/flint/flint.so # /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/reactor.pyc matches /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/reactor.py import twisted.internet.reactor # precompiled from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/reactor.pyc # /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/selectreactor.pyc matches /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/selectreactor.py import twisted.internet.selectreactor # precompiled from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/selectreactor.pyc # /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/interfaces.pyc matches /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/interfaces.py import twisted.internet.interfaces # precompiled from /home/punarbasu/Installations/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/interfaces.pyc Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: RuntimeError('maximum recursion depth exceeded while calling a Python object',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored ignored Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: RuntimeError('maximum recursion depth exceeded while calling a Python object',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored ignored Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: RuntimeError('maximum recursion depth exceeded while calling a Python object',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored ignored Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: RuntimeError('maximum recursion depth exceeded while calling a Python object',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored ignored Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: RuntimeError('maximum recursion depth exceeded while calling a Python object',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored ignored Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored Exception RuntimeError: RuntimeError('maximum recursion depth exceeded while calling a Python object',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored ignored
Changed 11 years ago by
Attachment: | trac_12061-doctest_interfaces_psage.2.patch added |
---|
Apply to devel/sage
comment:2 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Status: | new → needs_review |
Type: | defect → enhancement |
Finally I have been able to figure out the cause of the infinite recursion. The fix is present in the patch.
comment:3 Changed 11 years ago by
Two functions are not directly or indirectly doctested: PSage._send_nowait()
and PSageElement.is_locked()
. Is the latter class even used??
comment:4 follow-up: 5 Changed 11 years ago by
Status: | needs_review → needs_work |
---|
Why add time.sleep(10)
?
If you do, you also need to add "# long time".
comment:5 Changed 11 years ago by
Replying to jdemeyer:
Why add
time.sleep(10)
?If you do, you also need to add "# long time".
I did this after testing many different inputs and this was one input which doesn't take too long but which also doesn't give the result immediately. So, time.sleep(10)
is there to wait until the computations are all over.
Is there a better way to test this? Otherwise, I will add # long time
as you suggested.
comment:6 Changed 11 years ago by
Hmm.. I have a patch ready but I am unable to upload it. Something is wrong with trac. The upload page is simply stuck and never finishes the upload. I will just record the terminal output here and upload the patch some other day.
...2.experimental/devel/sage» ../../sage -t -long sage/interfaces/psage.py sage -t -long "devel/sage-main/sage/interfaces/psage.py" [24.8 s] ---------------------------------------------------------------------- All tests passed! Total time for all tests: 24.8 seconds ...2.experimental/devel/sage» ../../sage -coverage sage/interfaces/psage.py ---------------------------------------------------------------------- sage/interfaces/psage.py ERROR: Please add a `TestSuite(s).run()` doctest. SCORE sage/interfaces/psage.py: 71% (10 of 14) Missing documentation: * _start(self): * _send_nowait(self, x): * _object_class(self): * is_locked(self): ----------------------------------------------------------------------
comment:7 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Status: | needs_work → needs_review |
There seems to be some weird problem with trac. I am unable to upload the original file since it contained
:trac:`1991`
instead of
:trac:`#1991`
Even after I did that change, I am unable to upload it as a .patch file. So I renamed the file and it works.
Changed 11 years ago by
Attachment: | test.patch added |
---|
comment:8 Changed 11 years ago by
Keywords: | sd40.5 added |
---|
comment:10 Changed 11 years ago by
Keywords: | sd40.5 removed |
---|
removing sd40.5. This PSage has extremely weird behavior which changes between several different versions of Sage. The doctests used to all pass earlier and now they don't.
comment:12 Changed 10 years ago by
Authors: | → Punarbasu Purkayastha |
---|
Sorry jdemeyer. It seems I tend to not fill up author fields. Will try to remember to do so from next time.
comment:13 Changed 10 years ago by
Status: | needs_review → needs_work |
---|---|
Work issues: | → find out why doctests change every sage version |
comment:14 Changed 9 years ago by
Milestone: | sage-5.11 → sage-5.12 |
---|
comment:15 Changed 9 years ago by
Milestone: | sage-6.1 → sage-6.2 |
---|
comment:16 Changed 9 years ago by
Milestone: | sage-6.2 → sage-6.3 |
---|
comment:17 Changed 8 years ago by
Milestone: | sage-6.3 → sage-6.4 |
---|
Apply to devel/sage