zblz / naima

Derivation of non-thermal particle distributions through MCMC spectral fitting
http://naima.readthedocs.io
BSD 3-Clause "New" or "Revised" License
45 stars 54 forks source link

Fix docs sphinx warnings / errors #10

Closed cdeil closed 10 years ago

cdeil commented 11 years ago

I see a few warnings / errors when generating the sphinx docs locally. And looking at readthedocs there's a few entries in the public API that I guess shouldn't be there like gammafit.onezone. at the top-level page or ElectronOZM.warn.

Should I try to clean that up or do you have time to do it?

$ python setup.py build_sphinx
Freezing version number to gammafit/version.py
running build_sphinx
creating docs/_build/doctrees
running build
running build_py
creating build/lib.macosx-10.8-x86_64-2.7
creating build/lib.macosx-10.8-x86_64-2.7/gammafit
copying gammafit/__init__.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit
copying gammafit/core.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit
copying gammafit/onezone.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit
copying gammafit/plot.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit
copying gammafit/utils.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit
copying gammafit/version.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit
creating build/lib.macosx-10.8-x86_64-2.7/gammafit/tests
copying gammafit/tests/__init__.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit/tests
copying gammafit/tests/test_functionfit.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit/tests
copying gammafit/tests/test_onezone.py -> build/lib.macosx-10.8-x86_64-2.7/gammafit/tests
regenerating default gammafit.cfg file
copying gammafit/gammafit.cfg -> build/lib.macosx-10.8-x86_64-2.7/gammafit
Running Sphinx v1.1.3
INFO:root:Generating grammar tables from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/pycode/Grammar.txt
INFO:root:Writing grammar tables to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
INFO:root:Writing failed:[Errno 13] Permission denied: '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle'
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org/objects.inv...
loading intersphinx inventory from http://matplotlib.sourceforge.net/objects.inv...
loading intersphinx inventory from http://docs.scipy.org/doc/scipy/reference/objects.inv...
loading intersphinx inventory from http://www.astropy.org/objects.inv...
loading intersphinx inventory from http://h5py.alfven.org/docs-2.1/objects.inv...
loading intersphinx inventory from http://docs.scipy.org/doc/numpy/objects.inv...
[autosummary] generating autosummary for: gammafit/index.rst, index.rst, install.rst
[automodsumm] index.rst: found 14 automodsumm entries to generate
WARNING: [automodapi] failed to import 'gammafit.onezone.': no module named gammafit.onezone.
[automodsumm] gammafit/index.rst: found 14 automodsumm entries to generate
WARNING: [automodapi] failed to import 'gammafit.onezone.': no module named gammafit.onezone.
building [html]: all source files
updating environment: 16 added, 0 changed, 0 removed
reading sources... [100%] install                                              
/Users/deil/code/gammafit/build/lib.macosx-10.8-x86_64-2.7/gammafit/onezone.py:docstring of gammafit.onezone.ElectronOZM:121: ERROR: Malformed table.
Column span alignment problem in table line 3.

=========  ===============  ==========
   specsy   array [1/s/eV]  
                            Differential synchrotron spectrum: emitted synchrotron photons per unit
                            energy per second at energies given by `Eph`.

    sedsy    array [erg/s]  
                            Synchrotron SED := self.specsy*self.outspecene**2*u.eV.to('erg')

   specic   array [1/s/eV]  
                            Differential IC spectrum: emitted IC photons per unit energy per second
                            at energies given by `Eph`.

specictev  array [1/s/TeV]  
                            Differential IC spectrum in units typically used by IACT community.

    sedic    array [erg/s]  
                            IC SED := self.specic*self.outspecene**2*u.eV.to('erg')
=========  ===============  ==========
/Users/deil/code/gammafit/docs/gammafit/index.rst:14: WARNING: failed to import gammafit.onezone.<lambda>
/Users/deil/code/gammafit/docs/gammafit/index.rst:14: WARNING: toctree references unknown document u'_generated/triangle.corner'
/Users/deil/code/gammafit/docs/gammafit/index.rst:14: WARNING: toctree references unknown document u'_generated/gammafit.onezone.<lambda>'
/Users/deil/code/gammafit/docs/index.rst:15: WARNING: failed to import gammafit.onezone.<lambda>
/Users/deil/code/gammafit/docs/index.rst:15: WARNING: toctree references unknown document u'_generated/triangle.corner'
/Users/deil/code/gammafit/docs/index.rst:15: WARNING: toctree references unknown document u'_generated/gammafit.onezone.<lambda>'
looking for now-outdated files... none found
pickling environment... done
checking consistency... /Users/deil/code/gammafit/docs/gammafit/index.rst:: WARNING: document isn't included in any toctree
/Users/deil/code/gammafit/docs/install.rst:: WARNING: document isn't included in any toctree
done
preparing documents... done
zblz commented 11 years ago

I should write a decent documentation at some point, so I don't think it is worth it to fix these things as I hope that in the following weeks I will change most of it and I will look into these things. Thanks anyway!

cdeil commented 10 years ago

I noticed that the ElectronOZM attributes section is empty.

I want to compute some SEDs and learn gammafit, so I can fix the docs a bit while I read through them. In this case though I think the issue is simply that the gammafit builds on readthedocs are failing and thus the docs are outdated due to issue #13.

cdeil commented 10 years ago

I am fixing all Sphinx warnings in #13 ... once that is merged the docs build on readthedocs should automatically update again. Closing this issue...