[Numpy-discussion] sphinx numpydoc fails due to no __init__ for class SignedType

Peter Caldwell caldwell19@llnl....
Tue Jan 12 12:01:29 CST 2010


I'm trying to use sphinx to build documentation for our project (CDAT) 
that uses numpy.  I'm running into an exception due to 
numpy.numarray.numerictypes.SignedType not having an __init__ attribute, 
which causes problems with numpydoc.  I'm sure there must be a 
workaround or I'm doing something wrong since the basic numpy 
documentation is created with sphinx!  Suggestions?

I'm using sphinx v1.0, numpy v1.3.0, and numpydoc v0.3.1on Redhat 
Enterprise 5.x.

Big thanks,
Peter

ps - I'm sending this question to both Numpy-discussion and 
sphinx-dev@googlegroups because the issue lies at the intersection of 
these groups.

Here's the error:
=========================================================
Running Sphinx v1.0
loading pickled environment... not found
building [html]: targets for 6835 source files that are out of date
updating environment: 6835 added, 0 changed, 0 removed
/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/docscrape.py:117: 
UserWarning: Unknown section Unary Ufuncs:
  warn("Unknown section %s" % key)
/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/docscrape.py:117: 
UserWarning: Unknown section Binary Ufuncs:
  warn("Unknown section %s" % key)
/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/docscrape.py:117: 
UserWarning: Unknown section Seealso
  warn("Unknown section %s" % key)
reading sources... [  3%] 
output/lev0/numpy.numarray                                                
Exception occurred:
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/numpydoc.py", 
line 76, in mangle_signature
    'initializes x; see ' in pydoc.getdoc(obj.__init__)):
AttributeError: class SignedType has no attribute '__init__'
The full traceback has been saved in /tmp/sphinx-err-fprbpu.log, if you 
want to report the issue to the author.
Please also report this if it was a user error, so that a better error 
message can be provided next time.
Send reports to sphinx-dev@googlegroups.com. Thanks!
make: *** [html] Error 1
=====================================================
Here's the full traceback:
------------------------------------------------------------------------------------------------
# Sphinx version: 1.0
# Docutils version: 0.6 release
Traceback (most recent call last):
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/cmdline.py", 
line 172, in main
    app.build(all_files, filenames)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/application.py", 
line 130, in build
    self.builder.build_update()
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/builders/__init__.py", 
line 265, in build_update
    'out of date' % len(to_build))
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/builders/__init__.py", 
line 285, in build
    purple, length):
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/builders/__init__.py", 
line 131, in status_iterator
    for item in iterable:
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/environment.py", 
line 513, in update_generator
    self.read_doc(docname, app=app)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/environment.py", 
line 604, in read_doc
    pub.publish()
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/core.py", 
line 203, in publish
    self.settings)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/readers/__init__.py", 
line 69, in read
    self.parse()
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/readers/__init__.py", 
line 75, in parse
    self.parser.parse(self.input, document)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/__init__.py", 
line 157, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 170, in run
    input_source=document['source'])
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 233, in run
    context, state, transitions)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 421, in check_line
    return method(match, context, next_state)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2678, in underline
    self.section(title, source, style, lineno - 1, messages)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 323, in section
    self.new_subsection(title, lineno, messages)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 391, in new_subsection
    node=section_node, match_titles=1)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 278, in nested_parse
    node=node, match_titles=match_titles)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 233, in run
    context, state, transitions)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 421, in check_line
    return method(match, context, next_state)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2258, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2270, in explicit_construct
    return method(self, expmatch)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2013, in directive
    directive_class, match, type_name, option_presets)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2062, in run_directive
    result = directive_instance.run()
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/autodoc.py", 
line 1106, in run
    nested_parse_with_titles(self.state, self.result, node)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/util/__init__.py", 
line 298, in nested_parse_with_titles
    return state.nested_parse(content, 0, node, match_titles=1)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 278, in nested_parse
    node=node, match_titles=match_titles)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 233, in run
    context, state, transitions)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 421, in check_line
    return method(match, context, next_state)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2260, in explicit_markup
    self.explicit_list(blank_finish)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2289, in explicit_list
    match_titles=self.state_machine.match_titles)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 315, in nested_list_parse
    node=node, match_titles=match_titles)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 233, in run
    context, state, transitions)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/statemachine.py", 
line 421, in check_line
    return method(match, context, next_state)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2562, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2270, in explicit_construct
    return method(self, expmatch)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2013, in directive
    directive_class, match, type_name, option_presets)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/docutils/parsers/rst/states.py", 
line 2062, in run_directive
    result = directive_instance.run()
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/autosummary/__init__.py", 
line 192, in run
    items = self.get_items(names)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/autosummary/__init__.py", 
line 265, in get_items
    sig = documenter.format_signature()
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/autodoc.py", 
line 879, in format_signature
    return ModuleLevelDocumenter.format_signature(self)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/autodoc.py", 
line 384, in format_signature
    self.object, self.options, args, retann)
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/application.py", 
line 226, in emit_firstresult
    for result in self.emit(event, *args):
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/application.py", 
line 222, in emit
    result.append(callback(self, *args))
  File 
"/usr/local/cdat/release/5.2d/lib/python2.5/site-packages/Sphinx-1.0dev_20091202-py2.5.egg/sphinx/ext/numpydoc.py", 
line 76, in mangle_signature
    'initializes x; see ' in pydoc.getdoc(obj.__init__)):
AttributeError: class SignedType has no attribute '__init__'

-- 
Peter Caldwell
Program for Climate Model Diagnosis and Intercomparison
Lawrence Livermore National Lab
PO Box 808, L-103
Livermore, CA 94551-0808 
925-422-4197



More information about the NumPy-Discussion mailing list