From c95ffb6546ecc16f71a56102bd5d443a3945928c Mon Sep 17 00:00:00 2001 From: Benjamin Maier Date: Fri, 14 Sep 2018 21:23:14 +0200 Subject: [PATCH] better package management --- README.md | 12 ++++++++++++ docs/conf.py | 16 ++++++++++++++++ docs/requirements.txt | 5 ----- setup.py | 1 - 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9d5b319..a655f20 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,17 @@ If you get compiling errors, make sure that [pybind11](https://github.com/pybind Note that a C++11-compiler has to be installed on the system before installing `tacoma`. +## Packages not installed during installing + +The following packages are not installed during installation with `pip` since they're only required +for drawing and drawing is not essential. If you want to use `tacoma.drawing`, please install + + matplotlib + networkx + python-louvain (community) + + + ## Examples Check out the [sandbox directory](https://github.com/benmaier/tacoma/tree/master/sandbox]). @@ -88,3 +99,4 @@ visualize(temporal_network, frame_dt = 0.05) ``` ![visualization example](https://github.com/benmaier/tacoma/raw/master/img/tacoma_example.gif) + diff --git a/docs/conf.py b/docs/conf.py index 0017483..3c21e66 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,22 @@ import sys import os +from mock import Mock as MagicMock + +class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return Mock() + +MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot', 'matplotlib.collections', + 'lmfit', 'networkx', 'community', + 'scipy.optimize', 'scipy.stats', 'scipy.special', 'scipy.integrate', + 'numpy.polynomial', 'numpy.polynomial.polynomial', 'wget', + 'lmfit', + ] + +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. diff --git a/docs/requirements.txt b/docs/requirements.txt index 89eeb00..dededc6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1 @@ pybind11==2.2.3 -python-louvain==0.10 -scipy==1.1.0 -wget==3.2 -numpy==1.14.5 -lmfit==0.9.11 diff --git a/setup.py b/setup.py index 5e8ab96..2e1ef92 100644 --- a/setup.py +++ b/setup.py @@ -122,7 +122,6 @@ def build_extensions(self): 'wget', 'numpy', 'scipy', - 'python-louvain', 'lmfit', ], include_package_data = True,