Skip to content

Commit 7132be6

Browse files
committed
fixed displaying all nan arrays
1 parent 2ec3897 commit 7132be6

File tree

3 files changed

+6
-38
lines changed

3 files changed

+6
-38
lines changed
Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,8 @@
1-
.. py:currentmodule:: larray_editor
2-
3-
Syntax changes
4-
^^^^^^^^^^^^^^
5-
6-
* renamed ``MappingEditor.old_method_name()`` to :py:obj:`MappingEditor.new_method_name()` (closes :editor_issue:`1`).
7-
8-
* renamed ``old_argument_name`` argument of :py:obj:`MappingEditor.method_name()` to ``new_argument_name``.
9-
10-
11-
Backward incompatible changes
12-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13-
14-
* other backward incompatible changes
15-
16-
17-
New features
18-
^^^^^^^^^^^^
19-
20-
* added a feature (see the :ref:`miscellaneous section <misc_editor>` for details).
21-
22-
* added another feature in the editor (closes :editor_issue:`1`).
23-
24-
.. note::
25-
26-
- It works for foo bar !
27-
- It does not work for foo baz !
28-
29-
30-
.. _misc_editor:
31-
32-
Miscellaneous improvements
33-
^^^^^^^^^^^^^^^^^^^^^^^^^^
34-
35-
* improved something.
36-
1+
.. py:currentmodule:: larray_editor
372

383
Fixes
394
^^^^^
405

416
* 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
@@ -72,7 +72,7 @@
7272

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

7777

7878
def make_circle(width=20, radius=9):
@@ -100,6 +100,7 @@ def make_demo(width=20, ball_radius=5, path_radius=5, steps=30):
100100
sphere = make_sphere(9, 4)
101101
extreme_array = la.Array([-la.inf, -1, 0, la.nan, 1, la.inf])
102102
array_scalar = la.Array(0)
103+
arr_all_nan = la.Array([la.nan, la.nan])
103104
arr_empty = la.Array([])
104105
arr_empty_2d = la.Array([[], []])
105106
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
@@ -539,7 +539,7 @@ def scale_to_01range(value, vmin, vmax):
539539
array([ 0. , 1. , 0.5, 0. , 0.1, 1. ])
540540
"""
541541
if hasattr(value, 'shape') and value.shape:
542-
if vmin == vmax:
542+
if (np.isnan(vmin) and np.isnan(vmax)) or (vmin == vmax):
543543
return np.where(np.isnan(value), np.nan, 0)
544544
else:
545545
assert vmin < vmax

0 commit comments

Comments
 (0)