medpy icon indicating copy to clipboard operation
medpy copied to clipboard

Handle few deprecations in scipy

Open raamana opened this issue 4 years ago • 1 comments

during CI on my hiwenet, I discovered a ton of deprecation warnings from scipy : https://travis-ci.org/github/raamana/hiwenet/jobs/658810855

mostly asking medpy to move from scipy to numpy for functions such as sum, absolute, sqrt, square etc .. see below for a sample, and the above link for a full list.. If you can, can you try fix them? thanks.

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:126: 
DeprecationWarning: scipy.absolute is deprecated and will be removed in SciPy 2.0.0, use numpy.absolute instead
367    return scipy.sum(scipy.absolute(h1 - h2))

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:126: 
DeprecationWarning: scipy.sum is deprecated and will be removed in SciPy 2.0.0, use numpy.sum instead
464    return scipy.sum(scipy.absolute(h1 - h2))

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:101: 
DeprecationWarning: scipy.absolute is deprecated and will be removed in SciPy 2.0.0, use numpy.absolute instead
561    mult = scipy.absolute(h1 - h2)

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:103: 
DeprecationWarning: scipy.multiply is deprecated and will be removed in SciPy 2.0.0, use numpy.multiply instead
658    for _ in range(p - 1): dif = scipy.multiply(dif, mult)

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:104: 
DeprecationWarning: scipy.sum is deprecated and will be removed in SciPy 2.0.0, use numpy.sum instead
755    return math.pow(scipy.sum(dif), 1./p)

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:137: 
DeprecationWarning: scipy.absolute is deprecated and will be removed in SciPy 2.0.0, use numpy.absolute instead
852    return math.sqrt(scipy.sum(scipy.square(scipy.absolute(h1 - h2))))

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:137: 
DeprecationWarning: scipy.square is deprecated and will be removed in SciPy 2.0.0, use numpy.square instead
949    return math.sqrt(scipy.sum(scipy.square(scipy.absolute(h1 - h2))))
950
951

  /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:676: 
DeprecationWarning: scipy.sqrt is deprecated and will be removed in SciPy 2.0.0, use numpy.lib.scimath.sqrt instead
1519    result = scipy.sum(scipy.sqrt(h1 * h2))

raamana avatar Apr 13 '20 14:04 raamana

Thanks for telling me about this. I don't have much time currently. Probably won't change before the next release.

You are welcome to submit a patch, though.

On Mon, 13 Apr 2020, 16:45 Pradeep Reddy Raamana, [email protected] wrote:

during CI on my hiwenet http://GitHub.com/raamana/hiwenet, I discovered a ton of deprecation warnings from scipy : https://travis-ci.org/github/raamana/hiwenet/jobs/658810855

mostly asking medpy to move from scipy to numpy for functions such as sum, absolute, sqrt, square etc .. see below for a sample, and the above link for a full list.. Please fix them asap.

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:126: DeprecationWarning: scipy.absolute is deprecated and will be removed in SciPy 2.0.0, use numpy.absolute instead 367 return scipy.sum(scipy.absolute(h1 - h2))

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:126: DeprecationWarning: scipy.sum is deprecated and will be removed in SciPy 2.0.0, use numpy.sum instead 464 return scipy.sum(scipy.absolute(h1 - h2))

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:101: DeprecationWarning: scipy.absolute is deprecated and will be removed in SciPy 2.0.0, use numpy.absolute instead 561 mult = scipy.absolute(h1 - h2)

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:103: DeprecationWarning: scipy.multiply is deprecated and will be removed in SciPy 2.0.0, use numpy.multiply instead 658 for _ in range(p - 1): dif = scipy.multiply(dif, mult)

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:104: DeprecationWarning: scipy.sum is deprecated and will be removed in SciPy 2.0.0, use numpy.sum instead 755 return math.pow(scipy.sum(dif), 1./p)

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:137: DeprecationWarning: scipy.absolute is deprecated and will be removed in SciPy 2.0.0, use numpy.absolute instead 852 return math.sqrt(scipy.sum(scipy.square(scipy.absolute(h1 - h2))))

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:137: DeprecationWarning: scipy.square is deprecated and will be removed in SciPy 2.0.0, use numpy.square instead 949 return math.sqrt(scipy.sum(scipy.square(scipy.absolute(h1 - h2)))) 950 951

/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/medpy/metric/histogram.py:676: DeprecationWarning: scipy.sqrt is deprecated and will be removed in SciPy 2.0.0, use numpy.lib.scimath.sqrt instead 1519 result = scipy.sum(scipy.sqrt(h1 * h2))

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/loli/medpy/issues/95, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGLK7VVMB2IEC5BJWQZK2DRMMQQDANCNFSM4MHAAVTQ .

loli avatar Apr 13 '20 17:04 loli

This should be fixed in the 0.5.0 release 🎉 Relevant commit: ee89c059d0445ad97ea005194cbf571294b3b3ca

StellarStorm avatar Dec 15 '23 17:12 StellarStorm