[Numpy-discussion] trouble building docs with sphinx-0.6.1

Darren Dale dsdale24 at gmail.com
Wed Apr 1 17:20:20 EDT 2009


On Wed, Apr 1, 2009 at 4:40 PM, Pauli Virtanen <pav at iki.fi> wrote:

> Wed, 01 Apr 2009 11:48:59 -0400, Darren Dale wrote:
> > This morning I upgraded to sphinx-0.6.1, hoping to take advantage of all
> > the recent work that has been done to clean up and consolidate the web
> > of sphinx extensions. I'm seeing segfaults when I try to build my own
> > docs, or the h5py docs. I tried building the numpy documentation after
> > applying the attached patch. After building html, updating the
> > environment, reading sources, I see a slew of warnings and errors,
> > followed by:
> [clip]
>
> It was an incompatibility of Numpy's autosummary extension and
> Sphinx >= 0.6. It should now be fixed in Numpy trunk.
>

Thanks Pauli. I noticed some bad indentation in testing.decorators, maybe
this patch could be considered:

Index: numpy/testing/decorators.py
===================================================================
--- numpy/testing/decorators.py (revision 6831)
+++ numpy/testing/decorators.py (working copy)
@@ -1,4 +1,5 @@
-"""Decorators for labeling test objects
+"""
+Decorators for labeling test objects

 Decorators that merely return a modified version of the original
 function object are straightforward.  Decorators that return a new
@@ -11,7 +12,8 @@
 """

 def slow(t):
-    """Labels a test as 'slow'.
+    """
+    Labels a test as 'slow'.

     The exact definition of a slow test is obviously both subjective and
     hardware-dependent, but in general any individual test that requires
more
@@ -22,7 +24,8
@@
     return
t


 def
setastest(tf=True):
-    ''' Signals to nose that this function is or is not a
test
+
'''
+    Signals to nose that this function is or is not a
test



Parameters

----------
@@ -47,7 +50,8
@@
     return
set_test


 def skipif(skip_condition,
msg=None):
-    ''' Make function raise SkipTest exception if skip_condition is
true
+
'''
+    Make function raise SkipTest exception if skip_condition is
true



Parameters

----------
@@ -59,12 +63,12
@@
     msg :
string
         Message to give on raising a SkipTest
exception


-
Returns
-
-------
-   decorator :
function
-       Decorator, which, when applied to a function, causes
SkipTest
-       to be raised when the skip_condition was True, and the
function
-       to be called normally
otherwise.
+
Returns
+
-------
+    decorator :
function
+        Decorator, which, when applied to a function, causes
SkipTest
+        to be raised when the skip_condition was True, and the
function
+        to be called normally
otherwise.


     Notes
     -----
@@ -86,9 +90,9 @@

         def get_msg(func,msg=None):
             """Skip message with information about function being
skipped."""
-            if msg is None:
+            if msg is None:
                 out = 'Test skipped due to test condition'
-            else:
+            else:
                 out = '\n'+msg

             return "Skipping test: %s%s" % (func.__name__,out)
@@ -115,32 +119,33 @@
             skipper = skipper_gen
         else:
             skipper = skipper_func
-
+
         return nose.tools.make_decorator(f)(skipper)

     return skip_decorator


 def knownfailureif(fail_condition, msg=None):
-    ''' Make function raise KnownFailureTest exception if fail_condition is
true
+    '''
+    Make function raise KnownFailureTest exception if fail_condition is
true

     Parameters
     ----------
     fail_condition : bool or callable.
         Flag to determine whether to mark test as known failure (True)
         or not (False).  If the condition is a callable, it is used at
-        runtime to dynamically make the decision.  This is useful for
+        runtime to dynamically make the decision.  This is useful for
         tests that may require costly imports, to delay the cost
         until the test suite is actually executed.
     msg : string
         Message to give on raising a KnownFailureTest exception

-   Returns
-   -------
-   decorator : function
-       Decorator, which, when applied to a function, causes SkipTest
-       to be raised when the skip_condition was True, and the function
-       to be called normally otherwise.
+    Returns
+    -------
+    decorator : function
+        Decorator, which, when applied to a function, causes SkipTest
+        to be raised when the skip_condition was True, and the function
+        to be called normally otherwise.

     Notes
     -----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090401/9188a9d6/attachment.html>


More information about the NumPy-Discussion mailing list