[h5py] 139/455: Doc updates, workaround for Cython issue with module docstrings

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit 9c97a32d7988a2e9ba42cb4110c18df24cf42419
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Fri Oct 17 04:30:55 2008 +0000

    Doc updates, workaround for Cython issue with module docstrings
---
 docs/source/auto.rst   |  6 ++++++
 docs/source/automod.py | 39 +++++++++++++++++++++++++++++++++++++++
 docs/source/conf.py    |  8 +++++++-
 docs/source/h5a.rst    |  5 +++++
 docs/source/h5d.rst    |  5 +++++
 h5py/h5.pyx            |  8 +++++---
 h5py/h5a.pyx           | 12 ++++--------
 h5py/h5d.pyx           |  2 +-
 h5py/h5f.pyx           |  2 +-
 h5py/h5fd.pyx          |  2 +-
 h5py/h5g.pyx           |  2 +-
 h5py/h5i.pyx           |  2 +-
 h5py/h5l.pyx           |  2 +-
 h5py/h5p.pyx           |  3 +--
 h5py/h5r.pyx           |  2 +-
 h5py/h5s.pyx           |  2 +-
 h5py/h5t.pyx           |  2 +-
 h5py/h5z.pyx           |  2 +-
 18 files changed, 82 insertions(+), 24 deletions(-)

diff --git a/docs/source/auto.rst b/docs/source/auto.rst
new file mode 100644
index 0000000..c43a790
--- /dev/null
+++ b/docs/source/auto.rst
@@ -0,0 +1,6 @@
+.. toctree::
+    :maxdepth: 2
+
+    h5a
+    h5d
+
diff --git a/docs/source/automod.py b/docs/source/automod.py
new file mode 100644
index 0000000..93d45a2
--- /dev/null
+++ b/docs/source/automod.py
@@ -0,0 +1,39 @@
+
+"""
+    Requires patched version of autodoc.py
+    http://bugs.python.org/issue3422
+"""
+
+def setup(spx):
+
+    def proc_doc(app, what, name, obj, options, lines):
+        if what in ("function", "method") and lines[0].strip().startswith('('):
+            doclines = []
+            arglines = []
+            final_lines = arglines
+            for line in lines:
+                if len(line.strip()) == 0:
+                    final_lines = doclines
+                final_lines.append(line)
+            lines[:] = final_lines
+
+    def proc_sig(app, what, name, obj, options, signature, return_annotation):
+        if what in ("function","method") and obj.__doc__.strip().startswith('('):
+            lines = []
+            for line in obj.__doc__.split("\n"):
+                if len(line.strip()) == 0:
+                    break
+                lines.append(line)
+            sig = [x.strip() for x in " ".join(lines).split('=>')]
+            ret = ''
+            if len(sig) == 2:
+                sig, ret = sig
+                ret = " -> "+ret
+            else:
+                sig = sig[0]
+            if len(sig) == 2: sig = sig[0]+" "+sig[1]  # stupid bug in autodoc
+            return (sig, ret)
+
+    spx.connect('autodoc-process-signature', proc_sig)
+    spx.connect('autodoc-process-docstring', proc_doc)
+
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 0aad953..2496f51 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -23,7 +23,8 @@ import sys, os
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
+sys.path += [os.path.abspath('.')]
+extensions = ['sphinx.ext.autodoc', 'automod']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -177,3 +178,8 @@ latex_documents = [
 
 # If false, no module index is generated.
 #latex_use_modindex = True
+
+
+
+
+
diff --git a/docs/source/h5a.rst b/docs/source/h5a.rst
new file mode 100644
index 0000000..2be39e1
--- /dev/null
+++ b/docs/source/h5a.rst
@@ -0,0 +1,5 @@
+Module H5A
+==========
+
+.. automodule:: h5py.h5a
+    :members:
diff --git a/docs/source/h5d.rst b/docs/source/h5d.rst
new file mode 100644
index 0000000..ea51b41
--- /dev/null
+++ b/docs/source/h5d.rst
@@ -0,0 +1,5 @@
+Module H5D
+==========
+
+.. automodule:: h5py.h5d
+    :members:
diff --git a/h5py/h5.pyx b/h5py/h5.pyx
index b1395fd..e8368ce 100644
--- a/h5py/h5.pyx
+++ b/h5py/h5.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     Common support and versioning module for the h5py HDF5 interface.
 
@@ -119,14 +119,16 @@ cdef class H5PYConfig:
 """\
 Summary of h5py config
 ======================
+HDF5: %s
 1.6 API: %s
 1.8 API: %s
 Thread-aware: %s
 Diagnostic mode: %s
 Complex names: %s"""
 
-        rstr %= (bool(self.API_16), bool(self.API_18), bool(self.THREADS),
-                 bool(self.DEBUG), self.complex_names)
+        rstr %= ("%d.%d.%d" % get_libversion(), bool(self.API_16),
+                bool(self.API_18), bool(self.THREADS), bool(self.DEBUG),
+                self.complex_names)
         return rstr
 
 cdef H5PYConfig cfg = H5PYConfig()
diff --git a/h5py/h5a.pyx b/h5py/h5a.pyx
index b67d4b8..8c65085 100644
--- a/h5py/h5a.pyx
+++ b/h5py/h5a.pyx
@@ -10,6 +10,7 @@
 # 
 #-
 
+
 """
     Provides access to the low-level HDF5 "H5A" attribute interface.
 """
@@ -17,6 +18,7 @@
 include "config.pxi"
 include "sync.pxi"
 
+
 # Compile-time imports
 from h5 cimport init_hdf5, SmartStruct
 from h5t cimport TypeID, typewrap, py_create
@@ -305,14 +307,8 @@ cdef class AttrID(ObjectID):
         functions which always take an attribute instance as the first
         argument are presented as methods of this class.  
 
-        Properties:
-
-        name:   The attribute's name
-        dtype:  A Numpy dtype representing this attribute's type
-        shape:  A Numpy-style shape tuple representing the dataspace
-
-        Hashable: No
-        Equality: Identifier comparison
+        * Hashable: No
+        * Equality: Identifier comparison
     """
     property name:
         """The attribute's name"""
diff --git a/h5py/h5d.pyx b/h5py/h5d.pyx
index 3cec5ab..30f1ade 100644
--- a/h5py/h5d.pyx
+++ b/h5py/h5d.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     Provides access to the low-level HDF5 "H5D" dataset interface.
 """
diff --git a/h5py/h5f.pyx b/h5py/h5f.pyx
index 541b5de..68b97d3 100644
--- a/h5py/h5f.pyx
+++ b/h5py/h5f.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     Low-level operations on HDF5 file objects.
 """
diff --git a/h5py/h5fd.pyx b/h5py/h5fd.pyx
index b76313e..24aa7bc 100644
--- a/h5py/h5fd.pyx
+++ b/h5py/h5fd.pyx
@@ -12,7 +12,7 @@
 
 # This file contains code or comments from the HDF5 library.  See the file
 # licenses/hdf5.txt for the full HDF5 software license.
-print 'FD'
+
 include "config.pxi"
 include "sync.pxi"
 
diff --git a/h5py/h5g.pyx b/h5py/h5g.pyx
index a4df95a..e4370b8 100644
--- a/h5py/h5g.pyx
+++ b/h5py/h5g.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     Low-level HDF5 "H5G" group interface.
 """
diff --git a/h5py/h5i.pyx b/h5py/h5i.pyx
index fcc96fe..8ac3743 100644
--- a/h5py/h5i.pyx
+++ b/h5py/h5i.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     Identifier interface for object inspection.
 """
diff --git a/h5py/h5l.pyx b/h5py/h5l.pyx
index 822ee91..41687b2 100644
--- a/h5py/h5l.pyx
+++ b/h5py/h5l.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     API for the "H5L" family of link-related operations
 """
diff --git a/h5py/h5p.pyx b/h5py/h5p.pyx
index 772c2e3..be70098 100644
--- a/h5py/h5p.pyx
+++ b/h5py/h5p.pyx
@@ -9,8 +9,7 @@
 # $Date$
 # 
 #-
-
-
+__doc__ = \
 """
     HDF5 property list interface.
 """
diff --git a/h5py/h5r.pyx b/h5py/h5r.pyx
index 763c983..90dd227 100644
--- a/h5py/h5r.pyx
+++ b/h5py/h5r.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     H5R API for object and region references.
 
diff --git a/h5py/h5s.pyx b/h5py/h5s.pyx
index c32d413..ff09013 100644
--- a/h5py/h5s.pyx
+++ b/h5py/h5s.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     Low-level interface to the "H5S" family of data-space functions.
 """
diff --git a/h5py/h5t.pyx b/h5py/h5t.pyx
index 84db962..a3ecaa6 100644
--- a/h5py/h5t.pyx
+++ b/h5py/h5t.pyx
@@ -9,7 +9,7 @@
 # $Date$
 # 
 #-
-
+__doc__ = \
 """
     HDF5 "H5T" data-type API
 
diff --git a/h5py/h5z.pyx b/h5py/h5z.pyx
index f617249..22b6388 100644
--- a/h5py/h5z.pyx
+++ b/h5py/h5z.pyx
@@ -10,7 +10,7 @@
 # 
 #-
 
-
+__doc__ = \
 """
     Filter API and constants
 """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list