Merge pull request #2198 from sciunto/warnings

DOC: add a note on warning treatment
This commit is contained in:
Juan Nunez-Iglesias
2016-07-17 14:48:18 -05:00
committed by GitHub
+8
View File
@@ -73,6 +73,14 @@ issued::
float64 to uint8
array([ 0, 128, 255], dtype=uint8)
Warnings can be locally ignored with a context manager::
>>> import warnings
>>> image = np.array([0, 0.5, 1], dtype=float)
>>> with warnings.catch_warnings():
... warnings.simplefilter("ignore")
... img_as_ubyte(image)
array([ 0, 128, 255], dtype=uint8)
Additionally, some functions take a ``preserve_range`` argument where a range
conversion is convenient but not necessary. For example, interpolation in