Skip to content

Hurdles in building the docs #2952

Closed

Description

@wehlutyk

I had a few problems building the documentation while preparing #2953:

  • when starting from a clean virtualenv, after pip install numpy, pip install -e ., and pip install -e .[docs], I still need to manually install jupyter_client, ipykernel, and matplotlib for the build to run completely.
  • building the docs spits out thousands of SEVERE: Unexpected section title.; this happens whenever it sees a section title like
Parameters
----------
(...)

which seems to say my environment setup doesn't recognize the numpy docstring format (note numpydoc did get installed in the virtualenv). In fact the section titles don't appear in the rendered html.

  • although building with nbconvert 4.1.0 works fine, building with nbconvert 4.2.0 (which is what comes by default with pip install -e .[docs] at this date) fails with the following trace:
Executeing /home/sl/Code/Research/statsmodels/examples/notebooks/pca_fertility_factors.ipynb to /home/sl/Code/Research/statsmodels/examples/executed/pca_fertility_factors.ipynb
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib64/python3.5/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/lib64/python3.5/concurrent/futures/process.py", line 153, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/usr/lib64/python3.5/concurrent/futures/process.py", line 153, in <listcomp>
    return [fn(*args) for args in chunk]
  File "../tools/nbgenerate.py", line 93, in do_one
    kernel_name=kernel_name)
  File "../tools/nbgenerate.py", line 53, in execute_nb
    kernel_name=kernel_name)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/nbconvert/preprocessors/base.py", line 41, in __init__
    super(Preprocessor, self).__init__(**kw)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/nbconvert/utils/base.py", line 29, in __init__
    super(NbConvertBase, self).__init__(**kw)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/config/configurable.py", line 74, in __init__
    super(Configurable, self).__init__(**kwargs)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/traitlets.py", line 949, in __init__
    setattr(self, key, value)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/traitlets.py", line 558, in __set__
    self.set(obj, value)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/traitlets.py", line 532, in set
    new_value = self._validate(obj, value)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/traitlets.py", line 564, in _validate
    value = self.validate(obj, value)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/traitlets.py", line 1927, in validate
    self.error(obj, value)
  File "/home/sl/.virtualenvs/statsmodels/lib/python3.5/site-packages/traitlets/traitlets.py", line 598, in error
    raise TraitError(e)
traitlets.traitlets.TraitError: The 'kernel_name' trait of an ExecutePreprocessor instance must be a unicode string, but a value of None <class 'NoneType'> was specified.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "../tools/nbgenerate.py", line 140, in <module>
    main()
  File "../tools/nbgenerate.py", line 137, in main
    kernel_name=args.kernel_name)
  File "../tools/nbgenerate.py", line 109, in do
    for dst in pool.map(func, nbs):
  File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 556, in result_iterator
    yield future.result()
  File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
traitlets.traitlets.TraitError: The 'kernel_name' trait of an ExecutePreprocessor instance must be a unicode string, but a value of None <class 'NoneType'> was specified.
Makefile:61: recipe for target 'html' failed
make: *** [html] Error 1

Activity

  1. TomAugspurger commented on May 17, 2016

    @TomAugspurger
    Contributor

    nbcovert 4.2 wasn't released when I overhauled the doc build system a couple months back. It'd be good to pin that version along with adding jupyter_client, ipykernel, and matplotlib in the setup.py.

    I'm getting the section header warnings as well.

    For the last one, that's nbconvert letting you specify the kernel. I'll see if we have something to change now that 4.2 is available.

  2. josef-pkt commented on May 17, 2016

    @josef-pkt
    Member

    @wehlutyk What sphinx version are your using? It needs the most recent because the few previous once had bugs for docstring standard, AFAIR.

  3. wehlutyk commented on May 17, 2016

    @wehlutyk
    ContributorAuthor

    Thanks all for the swift responses!

    @josef-pkt Sphinx 1.4.1 which came from pip install -e .[docs] I think. Here's the output of pip freeze in my virtualenv (python 3.5):

    alabaster==0.7.8
    Babel==2.3.4
    backports.shutil-get-terminal-size==1.0.0
    cycler==0.10.0
    decorator==4.0.9
    docutils==0.12
    entrypoints==0.2.1
    imagesize==0.7.1
    ipykernel==4.3.1
    ipython==4.2.0
    ipython-genutils==0.1.0
    Jinja2==2.8
    jsonschema==2.5.1
    jupyter-client==4.2.2
    jupyter-core==4.1.0
    MarkupSafe==0.23
    matplotlib==1.5.1
    mistune==0.7.2
    nbconvert==4.1.0
    nbformat==4.0.1
    numpy==1.11.0
    numpydoc==0.6.0
    pandas==0.18.1
    patsy==0.4.1
    pexpect==4.0.1
    pickleshare==0.7.2
    ptyprocess==0.5.1
    Pygments==2.1.3
    pyparsing==2.1.4
    python-dateutil==2.5.3
    pytz==2016.4
    pyzmq==15.2.0
    scipy==0.17.1
    simplegeneric==0.8.1
    six==1.10.0
    snowballstemmer==1.2.1
    Sphinx==1.4.1
    -e [email protected]:wehlutyk/statsmodels.git@17cef1992701bb6ba72a3e40250618a852cbe59f#egg=statsmodels
    tornado==4.3
    traitlets==4.2.1
    
  4. josef-pkt commented on May 17, 2016

    @josef-pkt
    Member

    sphinx 1.4.1 That's a fast increase in sphinx version numbers
    the last one I used was 1.3.5 which looked better than the once before that
    #2312 (comment)

  5. TomAugspurger commented on May 17, 2016

    @TomAugspurger
    Contributor

    Whoops, looks like I forgot to include numpydoc in the docs/source/conf.py spihnx extensions. Added that and the section headers show up. I'll send along a PR tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions