From 2f5ebc9515f29cfa682cbd450ee97e0aa318caf0 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Mon, 27 Jun 2016 12:48:23 +0100 Subject: [PATCH] Array editor: Support float16 arrays. Fixes #3237. --- spyderlib/widgets/variableexplorer/arrayeditor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spyderlib/widgets/variableexplorer/arrayeditor.py b/spyderlib/widgets/variableexplorer/arrayeditor.py index e5e8aa36ba9..be3c4a529d0 100644 --- a/spyderlib/widgets/variableexplorer/arrayeditor.py +++ b/spyderlib/widgets/variableexplorer/arrayeditor.py @@ -47,6 +47,7 @@ 'double': '%.3f', 'float_': '%.3f', 'longfloat': '%.3f', + 'float16': '%.3f', 'float32': '%.3f', 'float64': '%.3f', 'float96': '%.3f', @@ -856,6 +857,9 @@ def test(): arr = np.array([1, 2, 3], dtype="int8") assert_array_equal(arr, test_edit(arr, "int array")) + arr = np.zeros((5,5), dtype=np.float16) + assert_array_equal(arr, test_edit(arr, "float array")) + arr = np.zeros((3,3,4)) arr[0,0,0]=1 arr[0,0,1]=2