Skip to content
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

Fix deprecated imports of scipy.ndimage.gaussian_filter #1311

Merged
merged 1 commit into from
Oct 31, 2022
Merged

Fix deprecated imports of scipy.ndimage.gaussian_filter #1311

merged 1 commit into from
Oct 31, 2022

Conversation

rbu
Copy link
Contributor

@rbu rbu commented Oct 12, 2022

scipy deprecated the use of the ndimage.filters submodule in v1.8.0 and plans to remove the compatibility import in v2.0.0 The filters were availalble in the ndimage module going back at least to 2012, and I tested the import on scipy==1.1.0.

Fixes the following error:

$ python -W always -c "import albumentations.augmentations.transforms" albumentations/albumentations/augmentations/geometric/functional.py:7: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
  from scipy.ndimage.filters import gaussian_filter

@Dipet
Copy link
Collaborator

Dipet commented Oct 18, 2022

I think that we also need to update the version requirements for libs for these changes https://github.com/albumentations-team/albumentations/blob/master/setup.py#L8

@rbu
Copy link
Contributor Author

rbu commented Oct 18, 2022

I think that we also need to update the version requirements for libs for these changes https://github.com/albumentations-team/albumentations/blob/master/setup.py#L8

Which dependency do you have in mind? Specifically for scipy, I tested that the "new" import location (i.e. the one that is not deprecated, and which this PR starts using) has been around in scipy 1.1.0 from 2012. I didn't run the full test suite to find out what the minimal version requirement actually are, but I doubt that this change would change that in practice.
That being said, I'm happy to run more tests or adapt version specs in this PR, if you let me know in what direction.

@jangop
Copy link
Contributor

jangop commented Oct 25, 2022

[...] Specifically for scipy, I tested that the "new" import location (i.e. the one that is not deprecated, and which this PR starts using) has been around in scipy 1.1.0 from 2012 [...]

In that case, specify scipy>=1.1.0 in setup.py. At the moment, no version is specified for scipy at all.

@rbu
Copy link
Contributor Author

rbu commented Oct 28, 2022

In that case, specify scipy>=1.1.0 in setup.py. At the moment, no version is specified for scipy at all.

I've adapted the branch accordingly and rebased to master.

scipy deprecated the use of the ndimage.filters submodule in v1.8.0 and plans to remove
the compatibility import in v2.0.0 The filters were availalble in the ndimage module going
back at least to 2012, and I tested the import on scipy==1.1.0.

Fixes the following error:
$ python -W always -c "import albumentations.augmentations.transforms"
albumentations/albumentations/augmentations/geometric/functional.py:7: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
  from scipy.ndimage.filters import gaussian_filter
@Dipet Dipet merged commit 57988c2 into albumentations-team:master Oct 31, 2022
@rbu rbu deleted the scipy-gaussian-filter-deprecation-warnings branch October 31, 2022 08:46
@rbu
Copy link
Contributor Author

rbu commented Nov 1, 2022

Thank you for the timely review and merge @jangop @Dipet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants