DOC: add a note on warning treatment

This commit is contained in:
François Boulogne
2016-07-17 12:18:00 +02:00
parent 418de7e4f0
commit eb33972e95
+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