Skip to content

Commit

Permalink
For scipy v>= 0.18, get logsumexp from scipy.special; fixes #364
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Nov 28, 2018
1 parent f3b6dcc commit dde3790
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion galpy/df/streamdf.py
Expand Up @@ -8,8 +8,10 @@
for v in scipy.__version__.split('.')]
if _SCIPY_VERSION[0] < 1 and _SCIPY_VERSION[1] < 10: #pragma: no cover
from scipy.maxentropy import logsumexp
else:
elif _SCIPY_VERSION[0] < 1 and _SCIPY_VERSION[1] < 19:
from scipy.misc import logsumexp
else: #pragma: no cover
from scipy.special import logsumexp
from galpy.orbit import Orbit
from .df import df, _APY_LOADED
from galpy.util import bovy_coords, fast_cholesky_invert, \
Expand Down
4 changes: 3 additions & 1 deletion galpy/orbit/FullOrbit.py
Expand Up @@ -7,8 +7,10 @@
for v in scipy.__version__.split('.')]
if _SCIPY_VERSION[0] < 1 and _SCIPY_VERSION[1] < 10: #pragma: no cover
from scipy.maxentropy import logsumexp
else:
elif _SCIPY_VERSION[0] < 1 and _SCIPY_VERSION[1] < 19:
from scipy.misc import logsumexp
else: #pragma: no cover
from scipy.special import logsumexp
from galpy.potential.Potential import _evaluateRforces, _evaluatezforces,\
evaluatePotentials, _evaluatephiforces, evaluateDensities, _check_c
from galpy.potential.DissipativeForce import _isDissipative
Expand Down
10 changes: 9 additions & 1 deletion galpy/potential/DiskSCFPotential.py
Expand Up @@ -3,7 +3,15 @@
###############################################################################
import copy
import numpy
from scipy.misc import logsumexp
import scipy
_SCIPY_VERSION= [int(v.split('rc')[0])
for v in scipy.__version__.split('.')]
if _SCIPY_VERSION[0] < 1 and _SCIPY_VERSION[1] < 10: #pragma: no cover
from scipy.maxentropy import logsumexp
elif _SCIPY_VERSION[0] < 1 and _SCIPY_VERSION[1] < 19:
from scipy.misc import logsumexp
else: #pragma: no cover
from scipy.special import logsumexp
from .Potential import Potential, _APY_LOADED
from .SCFPotential import SCFPotential, \
scf_compute_coeffs_axi, scf_compute_coeffs
Expand Down

0 comments on commit dde3790

Please sign in to comment.