[Scipy-svn] r6381 - trunk/scipy/stats

scipy-svn at scipy.org scipy-svn at scipy.org
Sat May 8 04:45:39 EDT 2010


Author: rgommers
Date: 2010-05-08 03:45:39 -0500 (Sat, 08 May 2010)
New Revision: 6381

Modified:
   trunk/scipy/stats/distributions.py
Log:
DOC: Put extradoc content in Notes section instead of at the end.

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2010-05-08 08:45:24 UTC (rev 6380)
+++ trunk/scipy/stats/distributions.py	2010-05-08 08:45:39 UTC (rev 6381)
@@ -74,6 +74,7 @@
 
 docheaders = {'methods':"""\nMethods\n-------\n""",
               'parameters':"""\nParameters\n---------\n""",
+              'notes':"""\nNotes\n-----\n""",
               'examples':"""\nExamples\n--------\n"""}
 
 _doc_rvs = \
@@ -157,8 +158,7 @@
       location, and scale fixed.
 """
 _doc_default_example = \
-"""
-Examples
+"""Examples
 --------
 >>> import matplotlib.pyplot as plt
 >>> numargs = %(name)s.numargs
@@ -643,9 +643,11 @@
 
     def _construct_default_doc(self, longname=None, extradoc=None):
         """Construct instance docstring from the default template."""
+        if extradoc.startswith('\n\n'):
+            extradoc = extradoc[2:]
         self.__doc__ = ''.join(['%s continuous random variable.'%longname,
-                                '\n\n%(default)s\n\n',
-                                extradoc])
+                                '\n\n%(before_notes)s\n', docheaders['notes'],
+                                extradoc, '\n%(example)s'])
         self._construct_doc()
 
     def _construct_doc(self):
@@ -3980,9 +3982,11 @@
 
     def _construct_default_doc(self, longname=None, extradoc=None):
         """Construct instance docstring from the rv_discrete template."""
+        if extradoc.startswith('\n\n'):
+            extradoc = extradoc[2:]
         self.__doc__ = ''.join(['%s discrete random variable.'%longname,
-                                '\n\n%(default)s\n\n',
-                                extradoc])
+                                '\n\n%(before_notes)s\n', docheaders['notes'],
+                                extradoc, '\n%(example)s'])
         self._construct_doc()
 
     def _construct_doc(self):




More information about the Scipy-svn mailing list