"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scipy/ndimage/_ni_support.py" between
scipy-1.6.2.tar.xz and scipy-1.6.3.tar.xz

About: SciPy are tools for mathematics, science, and engineering (for Python).

_ni_support.py  (scipy-1.6.2.tar.xz):_ni_support.py  (scipy-1.6.3.tar.xz)
skipping to change at line 86 skipping to change at line 86
else: else:
complex_type = numpy.promote_types(input.dtype, numpy.complex64) complex_type = numpy.promote_types(input.dtype, numpy.complex64)
output = numpy.zeros(shape, dtype=complex_type) output = numpy.zeros(shape, dtype=complex_type)
elif isinstance(output, (type, numpy.dtype)): elif isinstance(output, (type, numpy.dtype)):
# Classes (like `np.float32`) and dtypes are interpreted as dtype # Classes (like `np.float32`) and dtypes are interpreted as dtype
if complex_output and numpy.dtype(output).kind != 'c': if complex_output and numpy.dtype(output).kind != 'c':
warnings.warn("promoting specified output dtype to complex") warnings.warn("promoting specified output dtype to complex")
output = numpy.promote_types(output, numpy.complex64) output = numpy.promote_types(output, numpy.complex64)
output = numpy.zeros(shape, dtype=output) output = numpy.zeros(shape, dtype=output)
elif isinstance(output, str): elif isinstance(output, str):
output = numpy.typeDict[output] output = numpy.sctypeDict[output]
if complex_output and numpy.dtype(output).kind != 'c': if complex_output and numpy.dtype(output).kind != 'c':
raise RuntimeError("output must have complex dtype") raise RuntimeError("output must have complex dtype")
output = numpy.zeros(shape, dtype=output) output = numpy.zeros(shape, dtype=output)
elif output.shape != shape: elif output.shape != shape:
raise RuntimeError("output shape not correct") raise RuntimeError("output shape not correct")
elif complex_output and output.dtype.kind != 'c': elif complex_output and output.dtype.kind != 'c':
raise RuntimeError("output must have complex dtype") raise RuntimeError("output must have complex dtype")
return output return output
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)