Skip to content

Respect standard notations for images in functions arguments#2617

Merged
jni merged 1 commit intoscikit-image:masterfrom
sciunto:standard_img
Apr 19, 2017
Merged

Respect standard notations for images in functions arguments#2617
jni merged 1 commit intoscikit-image:masterfrom
sciunto:standard_img

Conversation

@sciunto
Copy link
Copy Markdown
Member

@sciunto sciunto commented Apr 15, 2017

Description

ready for reviews

See #2616 and #2538

  • img -> image
  • im -> image

@sciunto sciunto added the 🔧 type: Maintenance Refactoring and maintenance of internals label Apr 15, 2017
@pep8speaks
Copy link
Copy Markdown

pep8speaks commented Apr 15, 2017

Hello @sciunto! Thanks for updating the PR.

Line 78:58: E231 missing whitespace after ','
Line 78:76: E231 missing whitespace after ','

Line 41:1: W293 blank line contains whitespace
Line 54:80: E501 line too long (81 > 79 characters)
Line 223:80: E501 line too long (80 > 79 characters)

Line 32:80: E501 line too long (80 > 79 characters)
Line 41:17: E127 continuation line over-indented for visual indent
Line 55:80: E501 line too long (81 > 79 characters)
Line 103:20: E127 continuation line over-indented for visual indent
Line 105:20: E127 continuation line over-indented for visual indent

Line 187:80: E501 line too long (90 > 79 characters)
Line 195:80: E501 line too long (84 > 79 characters)
Line 205:80: E501 line too long (82 > 79 characters)
Line 206:80: E501 line too long (90 > 79 characters)
Line 207:80: E501 line too long (81 > 79 characters)
Line 219:80: E501 line too long (85 > 79 characters)

Line 238:9: E741 ambiguous variable name 'I'
Line 256:25: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
Line 304:80: E501 line too long (111 > 79 characters)

Line 111:80: E501 line too long (98 > 79 characters)
Line 276:80: E501 line too long (81 > 79 characters)
Line 288:80: E501 line too long (81 > 79 characters)
Line 457:80: E501 line too long (82 > 79 characters)

Line 54:26: E127 continuation line over-indented for visual indent

Line 3:1: E402 module level import not at top of file
Line 4:1: E402 module level import not at top of file
Line 5:1: E402 module level import not at top of file
Line 7:1: E402 module level import not at top of file
Line 32:80: E501 line too long (83 > 79 characters)
Line 55:80: E501 line too long (93 > 79 characters)
Line 237:80: E501 line too long (83 > 79 characters)

Line 38:32: E502 the backslash is redundant between brackets
Line 39:13: E122 continuation line missing indentation or outdented
Line 47:32: E502 the backslash is redundant between brackets
Line 48:13: E122 continuation line missing indentation or outdented
Line 97:1: E305 expected 2 blank lines after class or function definition, found 1

Line 25:80: E501 line too long (80 > 79 characters)
Line 170:80: E501 line too long (92 > 79 characters)
Line 580:80: E501 line too long (80 > 79 characters)

Line 119:80: E501 line too long (81 > 79 characters)

Line 263:80: E501 line too long (80 > 79 characters)

Line 103:14: E127 continuation line over-indented for visual indent
Line 105:12: E127 continuation line over-indented for visual indent
Line 146:26: E127 continuation line over-indented for visual indent

Comment last updated on April 19, 2017 at 05:38 Hours UTC

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 15, 2017

Codecov Report

Merging #2617 into master will not change coverage.
The diff coverage is 94.94%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2617   +/-   ##
=======================================
  Coverage   85.28%   85.28%           
=======================================
  Files         331      331           
  Lines       26350    26350           
=======================================
  Hits        22473    22473           
  Misses       3877     3877
Impacted Files Coverage Δ
skimage/restoration/inpaint.py 100% <100%> (ø) ⬆️
skimage/transform/seam_carving.py 100% <100%> (ø) ⬆️
skimage/segmentation/_chan_vese.py 100% <100%> (ø) ⬆️
skimage/_shared/testing.py 79.69% <100%> (ø) ⬆️
skimage/io/_plugins/matplotlib_plugin.py 87.83% <100%> (ø) ⬆️
skimage/transform/integral.py 97.43% <100%> (ø) ⬆️
skimage/feature/_daisy.py 100% <100%> (ø) ⬆️
skimage/restoration/_denoise.py 97.4% <100%> (ø) ⬆️
skimage/draw/draw.py 100% <100%> (ø) ⬆️
skimage/measure/profile.py 100% <100%> (ø) ⬆️
... and 6 more

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 7a6a2e5...0380de8. Read the comment docs.

@sciunto
Copy link
Copy Markdown
Member Author

sciunto commented Apr 15, 2017

Note: I changed the API of a private function for chan vese (_cv_init_level_set), images were passed but only the shape was used. Now, I pass the shape.

The rest is supposed to be only a bunch of substitutions.

@sciunto
Copy link
Copy Markdown
Member Author

sciunto commented Apr 16, 2017

@soupault congrat's, you arrived at the end :)



def plot_img_and_hist(img, axes, bins=256):
def plot_img_and_hist(image, axes, bins=256):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sciunto how about deprecating this in favour of plot_image_and_histogram? =) It's easy with our deprecated decorator!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh I just saw that this is an example! LOL well then it's even easier! =)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I prefer to do one thing at a time. There are plenty of things to change and doing that step by step make it easier to review and reduces the likelihood for errors.



def _cv_init_level_set(init_level_set, img):
def _cv_init_level_set(init_level_set, img_shape):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I feel like this rename should be image_shape or just shape

if image.ndim == 2:
image = image[..., np.newaxis]
if img.ndim == 2:
img = img[..., np.newaxis]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Erm.... What??? LOL

utils.assert_nD(img, (2, 3))
image = util.img_as_float(img, force_copy)
utils.assert_nD(image, (2, 3))
img = util.img_as_float(image, force_copy)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sciunto do you want to use this PR to deprecate img_as_* in favour of image_as_*? Your call if you want to leave for later PR. But you should definitely revert this img back to image. Dunno what happened there. =)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jni I don't think that it's worthwhile to do this. We have rescale_to_* on its way (#1234).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@soupault Ah! I forgot about that one! Thanks for the reminder!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That still leaves changing the assigned name to image, though. =)

Copy link
Copy Markdown
Member

@jni jni left a comment

Choose a reason for hiding this comment

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

@sciunto some of my comments are nitpicky, but some images got changed to imgs somehow, and they should be changed back. =)

@sciunto
Copy link
Copy Markdown
Member Author

sciunto commented Apr 19, 2017

@jni It's done! (I was tricked by the force_copy, that's why I changed the variable name).

@adius adius mentioned this pull request Apr 19, 2017
10 tasks
@jni jni merged commit ce1d6ab into scikit-image:master Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧐 Needs review 🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants