Skip to content

Commit

Permalink
Removes matplotlib, graphviz and seaborn from requirements.py, update…
Browse files Browse the repository at this point in the history
…s versioning.
  • Loading branch information
rutgerfick committed Apr 16, 2020
1 parent 2f109e8 commit 4aa1443
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion dmipy/core/acquisition_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from dipy.reconst.shm import real_sym_sh_mrtrix
from scipy.cluster.hierarchy import fcluster, linkage
from dipy.core.gradients import gradient_table, GradientTable
import matplotlib.pyplot as plt
from warnings import warn


Expand Down Expand Up @@ -330,6 +329,8 @@ def visualise_acquisition_G_Delta_rainbow(
bvals_ = b_from_g(G_grid.ravel(), delta[0], Delta_grid.ravel()) / 1e6
bvals_ = bvals_.reshape(G_grid.shape)

# local import because matplotlib is not in the strict requirements.
import matplotlib.pyplot as plt
plt.contourf(Delta_, G_, bvals_,
levels=bval_isolines,
cmap='rainbow', alpha=alpha_shading)
Expand Down
7 changes: 5 additions & 2 deletions dmipy/core/modeling_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
from ..optimizers.multi_tissue_convex_optimizer import (
MultiTissueConvexOptimizer)
from dipy.utils.optpkg import optional_package
from graphviz import Digraph
from uuid import uuid4
pathos, have_pathos, _ = optional_package("pathos")
numba, have_numba, _ = optional_package("numba")
graphviz, have_graphviz, _ = optional_package("graphviz")


if have_graphviz:
from graphviz import Digraph
if have_pathos:
import pathos.pools as pp
from pathos.helpers import cpu_count
Expand Down Expand Up @@ -755,6 +756,8 @@ def visualize_model_setup(
with_parameters: boolean,
Whether or not to also visualize the parameters of each model.
"""
if not have_graphviz:
raise ImportError('graphviz package not installed.')
dot = Digraph('Model Setup', format=im_format)
base_model = self.__class__.__name__
base_uuid = str(uuid4())
Expand Down
8 changes: 4 additions & 4 deletions dmipy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from os.path import join as pjoin

# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 1
_version_micro = '' # use '' for first of series, number for 1 and above
_version_extra = 'dev'
_version_major = 1
_version_minor = 0
_version_micro = 1 # use '' for first of series, number for 1 and above
_version_extra = ''
# _version_extra = '' # Uncomment this for full releases

# Construct full version string from these.
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ numpy(>=1.13)
scipy
dipy
cvxpy
matplotlib
boto
seaborn
pathlib
graphviz

0 comments on commit 4aa1443

Please sign in to comment.