Skip to content

Commit

Permalink
[Fix] Remove scipy.misc (#669)
Browse files Browse the repository at this point in the history
With the latest scipy 1.15 release `scipy.misc` was deprecated which
triggers a warning in autograd:
```
DeprecationWarning: scipy.misc is deprecated and will be removed in 2.0.0
    import scipy.misc as osp_misc
```

We only use the misc module to provide `logsumexp` which has been moved
to `scipy.special` many years ago, so removing the functionality should
not change anything for users on python>=3.9.

I also changed the import in the fluidsim example
([imread](https://docs.scipy.org/doc/scipy-1.2.3/reference/generated/scipy.ndimage.imread.html#scipy.ndimage.imread)
is deprecated in SciPy 1.0.0. Use matplotlib.pyplot.imread instead)
  • Loading branch information
fjosw authored Jan 6, 2025
1 parent 7970dbb commit 2213cec
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
5 changes: 0 additions & 5 deletions autograd/scipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
from . import integrate, signal, special, stats

try:
from . import misc
except ImportError:
pass
6 changes: 0 additions & 6 deletions autograd/scipy/misc.py

This file was deleted.

2 changes: 1 addition & 1 deletion examples/fluidsim/fluidsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import matplotlib
import matplotlib.pyplot as plt
from scipy.misc import imread
from matplotlib.pyplot import imread
from scipy.optimize import minimize

import autograd.numpy as np
Expand Down

0 comments on commit 2213cec

Please sign in to comment.