Skip to content

Commit

Permalink
DOC: api added
Browse files Browse the repository at this point in the history
  • Loading branch information
dgursoy committed Apr 11, 2015
1 parent 0bb1c3d commit 05dbb91
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 21 deletions.
5 changes: 0 additions & 5 deletions doc/api.rst

This file was deleted.

7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.io.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`data`
===========

.. automodule:: tomopy.io.data
:members:
:show-inheritance:
:undoc-members:
7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.io.phantom.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`phantom`
==============

.. automodule:: tomopy.io.phantom
:members:
:show-inheritance:
:undoc-members:
7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.io.recipe.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`recipe`
=============

.. automodule:: tomopy.io.recipe
:members:
:show-inheritance:
:undoc-members:
12 changes: 12 additions & 0 deletions doc/apidoc/tomopy.io.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:mod:`io`
=========

.. toctree::
tomopy.io.data
tomopy.io.phantom
tomopy.io.recipe

.. automodule:: tomopy.io
:members:
:show-inheritance:
:undoc-members:
7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.misc.morph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`morph`
============

.. automodule:: tomopy.misc.morph
:members:
:show-inheritance:
:undoc-members:
7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.misc.multiprocess.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`multiprocess`
===================

.. automodule:: tomopy.misc.multiprocess
:members:
:show-inheritance:
:undoc-members:
11 changes: 11 additions & 0 deletions doc/apidoc/tomopy.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:mod:`misc`
===========

.. toctree::
tomopy.misc.morph
tomopy.misc.multiprocess

.. automodule:: tomopy.misc
:members:
:show-inheritance:
:undoc-members:
7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.prep.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`prep`
===========

.. automodule:: tomopy.prep
:members:
:show-inheritance:
:undoc-members:
7 changes: 7 additions & 0 deletions doc/apidoc/tomopy.recon.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`recon`
============

.. automodule:: tomopy.recon
:members:
:show-inheritance:
:undoc-members:
15 changes: 15 additions & 0 deletions doc/apidoc/tomopy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
API reference
=============

.. toctree::
:maxdepth: 2

tomopy.io
tomopy.misc
tomopy.prep
tomopy.recon

.. automodule:: tomopy
:members:
:undoc-members:
:show-inheritance:
45 changes: 31 additions & 14 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,10 @@
import sys
import os

from mock import Mock as MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()

MOCK_MODULES = [
'numpy', 'scipy', 'scipy.misc', 'h5py', 'matplotlib',
'matplotlib.pylab', 'scikit-image', 'skimage.io', 'numpydoc']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(os.path.join('..')))
sys.path.insert(0, os.path.abspath(os.path.join('..', 'io')))
sys.path.insert(0, os.path.abspath('..'))

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -305,5 +292,35 @@ def __getattr__(cls, name):
# If true, do not generate a @detailmenu in the "Top" node's menu.
#ztexinfo_no_detailmenu = False

# picked from http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules # noqa
class Mock(object):

__all__ = []

def __init__(self, *args, **kwargs):
pass

def __call__(self, *args, **kwargs):
return Mock()

@classmethod
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name == 'c_byte':
return 0
else:
return Mock()

MOCK_MODULES = [
'numpy', 'scipy', 'scipy.misc', 'h5py', 'matplotlib', 'ctypes',
'matplotlib.pylab', 'scikit-image', 'skimage.io', 'numpydoc',
'scipy.ndimage', 'pywt', 'scipy.optimize', 'skimage',
'skimage.filter', 'skimage.morphology']

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()


# To turn-off the warnings at object generation.
numpydoc_show_class_members = False
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feel free to edit as you see fit!
quickstart
userguide
developer
api
apidoc/tomopy
questions
credits

Expand Down
2 changes: 1 addition & 1 deletion tomopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from __future__ import absolute_import, division, print_function

from tomopy.io import *
from tomopy.io.recipes import *
from tomopy.io.recipe import *
from tomopy.io.data import *
from tomopy.io.phantom import *
from tomopy.misc.morph import *
Expand Down
File renamed without changes.

0 comments on commit 05dbb91

Please sign in to comment.