Skip to content

Default edge mode change for resize and rescale - #2484

Merged
jni merged 3 commits into
scikit-image:masterfrom
grlee77:default_mode_change
Feb 7, 2017
Merged

jni merged 3 commits into
scikit-image:masterfrom
grlee77:default_mode_change

Conversation

@grlee77

@grlee77 grlee77 commented Feb 1, 2017 •

Copy link
Copy Markdown
Contributor

Description

Perhaps a bit late to go in for 0.13, but this PR warns about a pending change in the default edge mode from 'constant' to 'reflect' for both skimage.transform.resize and skimage.transform.reflect. This change was discussed in #1514 where the consensus was that this was preferable to the current default.

The only test that relies on the default edge mode being 'constant' to pass was test_resize3d_bilinear, so I have set mode='constant' explicitly in that case. The remaining tests use expected_warnings to verify that the warning is raised.

Examples and doctests were updated to explicitly use mode='reflect' to avoid warnings there.

not sure if 0.15 is the appropriate version to cite in the warning message

References

closes #1514

@sciunto sciunto added the 🔧 type: Maintenance Refactoring and maintenance of internals label Feb 1, 2017
@sciunto

sciunto commented Feb 1, 2017

Copy link
Copy Markdown
Member

Thanks!

2 quicks comments:

  • one of the references (PR number) looks wrong in your first post
  • We need to write a task in TODO.txt.

I let @jni decide if we include that in 0.13 or not.

@grlee77

grlee77 commented Feb 2, 2017

Copy link
Copy Markdown
Contributor Author

@sciunto: The bad reference was to scipy/scipy#4922 where there was some related discussion. (it was a mistake to list it as an issue to be closed here)

@codecov-io

codecov-io commented Feb 2, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #2484 into master will increase coverage by <.01%.

@@            Coverage Diff            @@
##           master   #2484      +/-   ##
=========================================
+ Coverage   90.69%   90.7%   +<.01%     
=========================================
  Files         304     304              
  Lines       21542   21557      +15     
  Branches     1860    1861       +1     
=========================================
+ Hits        19538   19553      +15     
  Misses       1661    1661              
  Partials      343     343
Impacted Files Coverage Δ
skimage/transform/tests/test_radon_transform.py 78.46% <100%> (ø) ✅
skimage/transform/_warps.py 98.25% <100%> (+0.03%) ✅
skimage/transform/tests/test_warps.py 99.56% <100%> (+0.02%) ✅

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30a19d0...f9f2a22. Read the comment docs.

@jni

jni commented Feb 3, 2017

Copy link
Copy Markdown
Member

Hi @grlee77, and thanks for this!

You missed a bit in the deprecation procedure:

  • the actual default should be changed to None and set to constant if it's None. This is to prevent a warning message in cases when people specifically asked for constant. See the example kindly being contributed by @sciunto here.
  • add an item to TODO.txt for 0.15.

@sciunto my official position on merging PRs just before the release is: if they are ready, and "minor", merge them. No sense holding them up for a release. If they are somehow controversial or likely to cause breakage/a delay in release, then we can hold them up — much better to have a broken master after the release than just before it!

So, @grlee77, if you can address the above comments, it'll go in forthwith! =)

@sciunto sciunto added this to the 0.13 milestone Feb 3, 2017
@grlee77

grlee77 commented Feb 3, 2017

Copy link
Copy Markdown
Contributor Author

okay. Hopefully all is in order now (That is a pretty nice example CONTRIBUTING.TXT by the way!). I can squash it down to fewer (or a single) commit(s) if you prefer.

@sciunto
sciunto requested review from jni and sciunto February 3, 2017 07:42
@sciunto

sciunto commented Feb 7, 2017

Copy link
Copy Markdown
Member

@grlee77 Sorry, the branch must be rebased. @jni could you check that it works for you?

use mode=None as default to avoid a warning if the user specifies mode='constant'
also update docstring examples to avoid warnings
@grlee77
grlee77 force-pushed the default_mode_change branch from b836e59 to f9f2a22 Compare February 7, 2017 17:20
@jni
jni merged commit ded1a3d into scikit-image:master Feb 7, 2017
@grlee77
grlee77 deleted the default_mode_change branch May 11, 2017 23:29
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.

interpolation: mode='constant' edge behaviour

5 participants