diff --git a/doc/conf.py b/doc/conf.py index 5e7d1d8b..45926c39 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -25,6 +25,19 @@ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' +#pretend to have the following dependecies (needed for autodoc generation) +from mock import Mock as MagicMock +class Mock(MagicMock): + pi = 3.141592653589793 + @classmethod + def __getattr__(cls, name): + return Mock() + +MOCK_MODULES = ['numpy', 'matplotlib.colors', 'matplotlib.pyplot', 'matplotlib', + 'scipy', 'scipy.ndimage', + 'scipy.ndimage.interpolation', 'matplotlib.ticker'] +sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) + # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. diff --git a/pip-requirements.txt b/pip-requirements.txt index 35c5e144..6d26535b 100644 --- a/pip-requirements.txt +++ b/pip-requirements.txt @@ -1,5 +1,6 @@ --index-url https://pypi.python.org/simple/ +mock pep8 nose -e . diff --git a/postpic/analyzer/analyzer.py b/postpic/analyzer/analyzer.py index 9ea9af85..dcb8142b 100644 --- a/postpic/analyzer/analyzer.py +++ b/postpic/analyzer/analyzer.py @@ -16,6 +16,7 @@ # # Stephan Kuschel 2014 import re +import numpy as np __all__ = ['PhysicalConstants', 'SpeciesIdentifier'] @@ -24,7 +25,6 @@ class PhysicalConstants: """ gives you some constants. """ - import numpy as np c = 299792458.0 me = 9.109383e-31 diff --git a/postpic/plotting/plotter_matplotlib.py b/postpic/plotting/plotter_matplotlib.py index d0d5dc46..cb2d43a2 100644 --- a/postpic/plotting/plotter_matplotlib.py +++ b/postpic/plotting/plotter_matplotlib.py @@ -21,7 +21,6 @@ """ import numpy as np -from .. import _const __all__ = ['MatplotlibPlotter']