Skip to content
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

Doctest interfaces/psage.py #12061

Open
ppurka opened this issue Nov 20, 2011 · 21 comments
Open

Doctest interfaces/psage.py #12061

ppurka opened this issue Nov 20, 2011 · 21 comments

Comments

@ppurka
Copy link
Member

ppurka commented Nov 20, 2011

Towards completing #12024.


Apply only attachment: trac_12061.txt to devel/sage.

Component: interfaces

Work Issues: find out why doctests change every sage version

Author: Punarbasu Purkayastha

Issue created by migration from https://trac.sagemath.org/ticket/12061

@ppurka
Copy link
Member Author

ppurka commented Nov 20, 2011

Apply to devel/sage

@ppurka
Copy link
Member Author

ppurka commented Nov 20, 2011

comment:1

Attachment: trac_12061-doctest_interfaces_psage.patch.gz

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

@ppurka
Copy link
Member Author

ppurka commented Mar 1, 2012

Attachment: trac_12061-doctest_interfaces_psage.2.patch.gz

Apply to devel/sage

@ppurka
Copy link
Member Author

ppurka commented Mar 1, 2012

comment:2

Finally I have been able to figure out the cause of the infinite recursion. The fix is present in the patch.

@ppurka

This comment has been minimized.

@ppurka
Copy link
Member Author

ppurka commented Mar 1, 2012

comment:3

Two functions are not directly or indirectly doctested: PSage._send_nowait() and PSageElement.is_locked(). Is the latter class even used??

@jdemeyer
Copy link

jdemeyer commented Apr 2, 2012

comment:4

Why add time.sleep(10)?

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

@ppurka
Copy link
Member Author

ppurka commented Apr 2, 2012

comment:5

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.

@ppurka
Copy link
Member Author

ppurka commented Apr 29, 2012

comment:6

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

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

@ppurka
Copy link
Member Author

ppurka commented May 1, 2012

Attachment: trac_12061.txt

Apply only this patch to devel/sage

@ppurka
Copy link
Member Author

ppurka commented May 1, 2012

comment:7

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.

@ppurka

This comment has been minimized.

@ppurka
Copy link
Member Author

ppurka commented May 26, 2012

Changed keywords from none to doctest sd40.5

@ppurka
Copy link
Member Author

ppurka commented May 26, 2012

comment:8

Attachment: test.patch.gz

@ppurka
Copy link
Member Author

ppurka commented May 27, 2012

comment:9

patchbot: apply trac_12061.txt

@ppurka
Copy link
Member Author

ppurka commented May 27, 2012

comment:10

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.

@ppurka
Copy link
Member Author

ppurka commented May 27, 2012

Changed keywords from doctest sd40.5 to none

@jdemeyer
Copy link

comment:11

Please fill in your real name as Author.

@ppurka
Copy link
Member Author

ppurka commented Jul 28, 2012

comment:12

Sorry jdemeyer. It seems I tend to not fill up author fields. Will try to remember to do so from next time.

@ppurka
Copy link
Member Author

ppurka commented Jul 28, 2012

Author: Punarbasu Purkayastha

@ppurka
Copy link
Member Author

ppurka commented Jul 28, 2012

Work Issues: find out why doctests change every sage version

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants