Opened 10 years ago

Last modified 7 years ago

#12061 needs_work enhancement

Doctest interfaces/psage.py

Reported by: ppurka Owned by: was
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:

Status badges

Description (last modified by ppurka)

Towards completing #12024.


Apply only trac_12061.txt to devel/sage.

Attachments (4)

trac_12061-doctest_interfaces_psage.patch (3.9 KB) - added by ppurka 10 years ago.
Apply to devel/sage
trac_12061-doctest_interfaces_psage.2.patch (7.7 KB) - added by ppurka 10 years ago.
Apply to devel/sage
trac_12061.txt (10.6 KB) - added by ppurka 10 years ago.
Apply only this patch to devel/sage
test.patch (870 bytes) - added by ppurka 10 years ago.

Download all attachments as: .zip

Change History (21)

Changed 10 years ago by ppurka

Apply to devel/sage

comment:1 Changed 10 years ago by ppurka

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 10 years ago by ppurka

Apply to devel/sage

comment:2 Changed 10 years ago by ppurka

  • Description modified (diff)
  • Status changed from new to needs_review
  • Type changed from defect to 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 10 years ago by ppurka

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: Changed 10 years ago by jdemeyer

  • Status changed from needs_review to needs_work

Why add time.sleep(10)?

If you do, you also need to add "# long time".

comment:5 in reply to: ↑ 4 Changed 10 years ago by ppurka

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 10 years ago by ppurka

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):

----------------------------------------------------------------------

Changed 10 years ago by ppurka

Apply only this patch to devel/sage

comment:7 Changed 10 years ago by ppurka

  • Description modified (diff)
  • Status changed from needs_work to 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 10 years ago by ppurka

comment:8 Changed 10 years ago by ppurka

  • Keywords sd40.5 added

comment:9 Changed 10 years ago by ppurka

patchbot: apply trac_12061.txt

comment:10 Changed 10 years ago by ppurka

  • 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:11 Changed 9 years ago by jdemeyer

Please fill in your real name as Author.

comment:12 Changed 9 years ago by ppurka

  • Authors set to 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 9 years ago by ppurka

  • Status changed from needs_review to needs_work
  • Work issues set to find out why doctests change every sage version

comment:14 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:15 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:16 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:17 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.