Skip to content

Commit

Permalink
Merge pull request #296 from choderalab/replace_scipymisc
Browse files Browse the repository at this point in the history
Replace scipy.misc
  • Loading branch information
Lnaden committed Feb 28, 2018
2 parents a511aad + 837a422 commit d4c974a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ script:
env:
matrix:
- python=2.7 CONDA_PY=27
- python=3.4 CONDA_PY=34
- python=3.5 CONDA_PY=35
- python=3.6 CONDA_PY=36

Expand Down
1 change: 0 additions & 1 deletion pymbar/tests/test_covariance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import pymbar
from pymbar.utils_for_testing import eq
import scipy.misc
from nose import SkipTest

def load_oscillators(n_states, n_samples):
Expand Down
1 change: 0 additions & 1 deletion pymbar/tests/test_mbar_solvers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import pymbar
from pymbar.utils_for_testing import eq
import scipy.misc
from nose import SkipTest


Expand Down
11 changes: 7 additions & 4 deletions pymbar/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import numpy as np
import pymbar
from pymbar.utils_for_testing import eq
import scipy.misc
from nose import SkipTest
try:
from scipy.special import logsumexp
except ImportError:
from scipy.misc import logsumexp


def test_logsumexp():
a = np.random.normal(size=(200, 500, 5))

for axis in range(a.ndim):
ans_ne = pymbar.utils.logsumexp(a, axis=axis)
ans_no_ne = pymbar.utils.logsumexp(a, axis=axis, use_numexpr=False)
ans_scipy = scipy.misc.logsumexp(a, axis=axis)
ans_scipy = logsumexp(a, axis=axis)
eq(ans_ne, ans_no_ne)
eq(ans_ne, ans_scipy)

Expand All @@ -21,7 +24,7 @@ def test_logsumexp_b():
for axis in range(a.ndim):
ans_ne = pymbar.utils.logsumexp(a, b=b, axis=axis)
ans_no_ne = pymbar.utils.logsumexp(a, b=b, axis=axis, use_numexpr=False)
ans_scipy = scipy.misc.logsumexp(a, b=b, axis=axis)
ans_scipy = logsumexp(a, b=b, axis=axis)
eq(ans_ne, ans_no_ne)
eq(ans_ne, ans_scipy)

Expand Down
2 changes: 1 addition & 1 deletion pymbar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def logsumexp(a, axis=None, b=None, use_numexpr=True):
See Also
--------
numpy.logaddexp, numpy.logaddexp2, scipy.misc.logsumexp
numpy.logaddexp, numpy.logaddexp2, scipy.misc.logsumexp (soon to be replaced with scipy.special.logsumexp)
Notes
-----
Expand Down

0 comments on commit d4c974a

Please sign in to comment.