-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle warnings about upcoming deprecations #1303
Comments
Couple of things: most of these are very simple. |
I'm getting the same warning (repeated many many times) from line 955 of spatial.py ( from scipy.ndimage.morphology import generate_binary_structure, iterate_structure, grey_dilation Since these are now imported at the top level, this line can just be removed, right? |
@ethanbb Ah, yes. Good spot. I've been trying to remove non-toplevel imports when I find them. You want to do it or shall I? |
I can do it no problem! I'll do a quick search for any other similar cases first. |
So actually there is this comment in the same file: CaImAn/caiman/source_extraction/cnmf/spatial.py Lines 355 to 359 in bb55800
which seems to imply that the local imports are needed for ipyparallel or multiprocessing workers. But I don't think that's true; anything defined at the module level, including imports, should be accessible to the workers regardless of how they are launched, right? |
Turned off warnings and checked for upcoming deprecations. Most of these are repeated many times in the different notebooks, just noting the warnings not where they are occurring in the code base:
caiman\utils\visualization.py:783: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use
matplotlib.colormaps[name]
ormatplotlib.colormaps.get_cmap(obj)
instead. (colormap = matplotlib.cm.get_cmap(cmap) # choose any matplotlib colormap here)caiman\source_extraction\cnmf\spatial.py:844: DeprecationWarning: Please use
grey_dilation
from thescipy.ndimage
namespace, thescipy.ndimage.morphology
namespace is deprecated. from scipy.ndimage.morphology import grey_dilation. (evaluate_components)A couple to not handle now, or not our problem:
random.py:370: DeprecationWarning: non-integer arguments to randrange() have been deprecated since Python 3.10 and will be removed in a subsequent version return self.randrange(a, b+1) (nb_view_components) [not our direct problem other than Python versioning, which is our problem -- for Windows users Python 3.10 is currently the main successful build, so ... 😬 ]
caiman\base\rois.py:56: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray. Coor = np.matrix([np.outer(np.ones(d2), np.arange(d1)).ravel(), [Handle later -- see note below in first comment]
The text was updated successfully, but these errors were encountered: