243754abffee934278db17978f284c46b77780df,scipy/ndimage/interpolation.py,,shift,#Any#Any#Any#Any#Any#Any#Any#,551

Before Change


    if order < 0 or order > 5:
        raise RuntimeError("spline order not supported")
    input = numpy.asarray(input)
    if numpy.iscomplexobj(input):
        raise TypeError("Complex type not supported")
    if input.ndim < 1:
        raise RuntimeError("input and output rank must be > 0")
    if prefilter and order > 1:
        padded, npad = _prepad_for_spline_filter(input, mode, cval)
        filtered = spline_filter(padded, order, output=numpy.float64,
                                 mode=mode)
    else:
        npad = 0
        filtered = input
    mode = _ni_support._extend_mode_to_code(mode)
    output = _ni_support._get_output(output, input)
    shift = _ni_support._normalize_sequence(shift, input.ndim)
    shift = [-ii for ii in shift]
    shift = numpy.asarray(shift, dtype=numpy.float64)
    if not shift.flags.contiguous:

After Change


    input = numpy.asarray(input)
    if input.ndim < 1:
        raise RuntimeError("input and output rank must be > 0")
    complex_output = numpy.iscomplexobj(input)
    output = _ni_support._get_output(output, input,
                                     complex_output=complex_output)
    if complex_output:
        // import under different name to avoid confusion with shift parameter
        from scipy.ndimage.interpolation import shift as _shift

        kwargs = dict(order=order, mode=mode, cval=cval, prefilter=prefilter)
        _shift(input.real, shift, output=output.real, **kwargs)
        _shift(input.imag, shift, output=output.imag, **kwargs)
        return output
    if prefilter and order > 1:
        padded, npad = _prepad_for_spline_filter(input, mode, cval)
        filtered = spline_filter(padded, order, output=numpy.float64,
                                 mode=mode)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 16

Instances


Project Name: scipy/scipy
Commit Name: 243754abffee934278db17978f284c46b77780df
Time: 2020-11-12
Author: grlee77@gmail.com
File Name: scipy/ndimage/interpolation.py
Class Name:
Method Name: shift


Project Name: scipy/scipy
Commit Name: 243754abffee934278db17978f284c46b77780df
Time: 2020-11-12
Author: grlee77@gmail.com
File Name: scipy/ndimage/interpolation.py
Class Name:
Method Name: zoom


Project Name: scipy/scipy
Commit Name: 243754abffee934278db17978f284c46b77780df
Time: 2020-11-12
Author: grlee77@gmail.com
File Name: scipy/ndimage/interpolation.py
Class Name:
Method Name: geometric_transform


Project Name: scipy/scipy
Commit Name: 243754abffee934278db17978f284c46b77780df
Time: 2020-11-12
Author: grlee77@gmail.com
File Name: scipy/ndimage/interpolation.py
Class Name:
Method Name: shift


Project Name: scipy/scipy
Commit Name: 243754abffee934278db17978f284c46b77780df
Time: 2020-11-12
Author: grlee77@gmail.com
File Name: scipy/ndimage/interpolation.py
Class Name:
Method Name: affine_transform


Project Name: scipy/scipy
Commit Name: 243754abffee934278db17978f284c46b77780df
Time: 2020-11-12
Author: grlee77@gmail.com
File Name: scipy/ndimage/interpolation.py
Class Name:
Method Name: map_coordinates