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

Default value for "mode" in "ndimage.shift" #9383

Closed
lbellomo opened this issue Oct 17, 2018 · 3 comments
Closed

Default value for "mode" in "ndimage.shift" #9383

lbellomo opened this issue Oct 17, 2018 · 3 comments

Comments

@lbellomo
Copy link
Contributor

@lbellomo lbellomo commented Oct 17, 2018

In scipy.ndimage.shift the mode's default value is 'constant', but in the documentation it says Default is 'reflect'.
Which of the two is wrong?

@ilayn

This comment has been minimized.

Copy link
Member

@ilayn ilayn commented Oct 17, 2018

The documentation of the ndimage funcs come from

_mode_doc = (
"""mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
The `mode` parameter determines how the input array is extended
when the filter overlaps a border. Default is 'reflect'. Behavior
for each valid value is as follows:
'reflect' (`d c b a | a b c d | d c b a`)
The input is extended by reflecting about the edge of the last
pixel.
'constant' (`k k k k | a b c d | k k k k`)
The input is extended by filling all values beyond the edge with
the same constant value, defined by the `cval` parameter.
'nearest' (`a a a a | a b c d | d d d d`)
The input is extended by replicating the last pixel.
'mirror' (`d c b | a b c d | c b a`)
The input is extended by reflecting about the center of the last
pixel.
'wrap' (`a b c d | a b c d | a b c d`)
The input is extended by wrapping around to the opposite edge.""")

if they are marked with the decorator .

Here it seems that the autodocs need to be corrected to constant since the signature shows constant which is the value that is passed by default and this applies to all funcs.

@ilayn ilayn changed the title Defait value for paramter mode in scipy.ndimage.shift Default value for "mode" in "ndimage.shift" Oct 17, 2018
@ilayn

This comment has been minimized.

Copy link
Member

@ilayn ilayn commented Oct 17, 2018

Xref #8528

@lbellomo

This comment has been minimized.

Copy link
Contributor Author

@lbellomo lbellomo commented Oct 17, 2018

Ok, i fix that in this PR: #9387

Thanks for the help @ilayn !

@ilayn ilayn closed this in #9387 Oct 18, 2018
@ilayn ilayn added this to the 1.2.0 milestone Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.