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

Remove deprecated functions and arguments for the 0.19 release #5463

Merged
merged 25 commits into from
Aug 9, 2021

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Jul 8, 2021

Description

This PR implements the remaining deprecations listed under the 0.19 section of TODO.txt. These are broken up into separate small commits for easier reviewing.

Checklist

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.

@grlee77 grlee77 added the 🔧 type: Maintenance Refactoring and maintenance of internals label Jul 8, 2021
@grlee77 grlee77 added this to the 0.19 milestone Jul 8, 2021
@grlee77
Copy link
Contributor Author

grlee77 commented Jul 8, 2021

Implemented a couple of remaining deprecations missing from the TODO as found by grep -rI "0.19" in the codebase.

Also fixed f2878e5 by adding the removal of draw.circle (forgot to save and commit that change previously!)

skimage/segmentation/slic_superpixels.py Outdated Show resolved Hide resolved
skimage/segmentation/slic_superpixels.py Outdated Show resolved Hide resolved
* In ``skimage/segmentation/morphsnakes.py`` remove ``circle_level_set'' and related tests.
* Also make sure to look in the function ``_init_level_set``
* In ``skimage/morphology/_flood_fill.py`` replace the deprecated parameter
in flood_fill() ``inplace`` with ``in_place`` and update the tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't follow when or why this change was decided on... pandas speaks 'inplace' so it seems more standard to me. Oh well.

Copy link
Contributor Author

@grlee77 grlee77 Jul 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember, but I think it was for consistency with several other functions that use in_place. It looks like a number of functions under future/graph already have in_place, also morphology.remove_small_holes and morphology.remove_small_objects

Copy link
Contributor Author

@grlee77 grlee77 Jul 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, most of those are still in future, so changes are probably expected there. I wonder if there are other prominent examples of inplace aside from pandas?

I don't think SciPy or NumPy tend to use either, usually requiring an out or output argument to be specified instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember, but I think it was for consistency with several other functions that use in_place. It looks like a number of functions under future/graph already have in_place

Ok.

also morphology.remove_small_holes and morphology.remove_small_objects

Right, but it looks like the argument is going away altogether for 1.0!

@remove_arg("in_place", changed_version="1.0",

And going NumPy-style instead:
help_msg="Please use out argument instead.")

Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org>
@grlee77
Copy link
Contributor Author

grlee77 commented Jul 17, 2021

Thanks for reviewing this fairly long PR @mkcor!

Copy link
Member

@rfezzani rfezzani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @grlee77, just left 2 minor suggestions.

skimage/util/tests/test_arraypad.py Outdated Show resolved Hide resolved
skimage/segmentation/slic_superpixels.py Outdated Show resolved Hide resolved
grlee77 and others added 2 commits August 9, 2021 09:38
Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
I believe these are copies of test cases already in NumPy
Copy link
Member

@rfezzani rfezzani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you @grlee77. just waiting for the green CI before merge 😉

@rfezzani rfezzani merged commit 6ba3375 into scikit-image:main Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 type: Maintenance Refactoring and maintenance of internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants