Skip to content

Commit 230cca7

Browse files
committed
fixed displaying all nan arrays
1 parent 3efd04b commit 230cca7

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

doc/source/changes/version_0_32_2.rst.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ Fixes
44
^^^^^
55

66
* fixed spurious warning in the console when an expression results in an empty sequence (array, list, tuple).
7+
8+
* fixed displaying arrays entirely filled with NaN.

larray_editor/tests/test_api_larray.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
# test isssue #35
7272
arr7 = la.from_lists([['a', 1, 2, 3],
73-
[ '', 1664780726569649730, -9196963249083393206, -7664327348053294350]])
73+
[ '', 1664780726569649730, -9196963249083393206, -7664327348053294350]])
7474

7575

7676
def make_circle(width=20, radius=9):
@@ -98,6 +98,7 @@ def make_demo(width=20, ball_radius=5, path_radius=5, steps=30):
9898
sphere = make_sphere(9, 4)
9999
extreme_array = la.Array([-la.inf, -1, 0, la.nan, 1, la.inf])
100100
array_scalar = la.Array(0)
101+
arr_all_nan = la.Array([la.nan, la.nan])
101102
arr_empty = la.Array([])
102103
arr_empty_2d = la.Array([[], []])
103104
arr_obj = la.ndtest((2, 3)).astype(object)

larray_editor/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def scale_to_01range(value, vmin, vmax):
524524
array([ 0. , 1. , 0.5, 0. , 0.1, 1. ])
525525
"""
526526
if hasattr(value, 'shape') and value.shape:
527-
if vmin == vmax:
527+
if (np.isnan(vmin) and np.isnan(vmax)) or (vmin == vmax):
528528
return np.where(np.isnan(value), np.nan, 0)
529529
else:
530530
assert vmin < vmax

0 commit comments

Comments
 (0)