From c9f909def29039ba115491feb2dbbd05a21e357c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Tue, 31 Mar 2020 11:58:29 +0200 Subject: [PATCH 1/7] bump version to 0.32.2-dev --- condarecipe/larray-editor/meta.yaml | 4 +-- doc/source/changes.rst | 8 +++++ doc/source/changes/version_0_32_2.rst.inc | 41 +++++++++++++++++++++++ larray_editor/__init__.py | 2 +- setup.py | 2 +- 5 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 doc/source/changes/version_0_32_2.rst.inc diff --git a/condarecipe/larray-editor/meta.yaml b/condarecipe/larray-editor/meta.yaml index 9f7a89a..01204ee 100644 --- a/condarecipe/larray-editor/meta.yaml +++ b/condarecipe/larray-editor/meta.yaml @@ -1,9 +1,9 @@ package: name: larray-editor - version: 0.32.1 + version: 0.32.2-dev source: - git_tag: 0.32.1 + git_tag: 0.32.2-dev git_url: https://github.com/larray-project/larray-editor.git # git_tag: master # git_url: file://c:/Users/gdm/devel/larray-editor/.git diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 0fbde99..7f27fe7 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -1,6 +1,14 @@ Change log ########## +Version 0.32.2 +============== + +In development. + +.. include:: ./changes/version_0_32_2.rst.inc + + Version 0.32.1 ============== diff --git a/doc/source/changes/version_0_32_2.rst.inc b/doc/source/changes/version_0_32_2.rst.inc new file mode 100644 index 0000000..c4533eb --- /dev/null +++ b/doc/source/changes/version_0_32_2.rst.inc @@ -0,0 +1,41 @@ +.. py:currentmodule:: larray_editor + +Syntax changes +^^^^^^^^^^^^^^ + +* renamed ``MappingEditor.old_method_name()`` to :py:obj:`MappingEditor.new_method_name()` (closes :editor_issue:`1`). + +* renamed ``old_argument_name`` argument of :py:obj:`MappingEditor.method_name()` to ``new_argument_name``. + + +Backward incompatible changes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* other backward incompatible changes + + +New features +^^^^^^^^^^^^ + +* added a feature (see the :ref:`miscellaneous section ` for details). + +* added another feature in the editor (closes :editor_issue:`1`). + + .. note:: + + - It works for foo bar ! + - It does not work for foo baz ! + + +.. _misc_editor: + +Miscellaneous improvements +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* improved something. + + +Fixes +^^^^^ + +* fixed something (closes :editor_issue:`1`). diff --git a/larray_editor/__init__.py b/larray_editor/__init__.py index 4aabcff..ad0be5e 100644 --- a/larray_editor/__init__.py +++ b/larray_editor/__init__.py @@ -2,4 +2,4 @@ from larray_editor.api import * -__version__ = '0.32.1' +__version__ = '0.32.2-dev' diff --git a/setup.py b/setup.py index 144dee0..29a858f 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def readlocal(fname): DISTNAME = 'larray-editor' -VERSION = '0.32.1' +VERSION = '0.32.2-dev' AUTHOR = 'Gaetan de Menten, Geert Bryon, Johan Duyck, Alix Damman' AUTHOR_EMAIL = 'gdementen@gmail.com' DESCRIPTION = "Graphical User Interface for LArray library" From fd349e4f7da2436bb679c23b9c7964810ef471ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 8 Nov 2019 12:29:30 +0100 Subject: [PATCH 2/7] added test for empty 2d array --- larray_editor/tests/test_api_larray.py | 1 + 1 file changed, 1 insertion(+) diff --git a/larray_editor/tests/test_api_larray.py b/larray_editor/tests/test_api_larray.py index a934cd7..c0ae484 100644 --- a/larray_editor/tests/test_api_larray.py +++ b/larray_editor/tests/test_api_larray.py @@ -101,6 +101,7 @@ def make_demo(width=20, ball_radius=5, path_radius=5, steps=30): extreme_array = la.Array([-la.inf, -1, 0, la.nan, 1, la.inf]) scalar = la.Array(0) arr_empty = la.Array([]) +arr_empty_2d = la.Array([[], []]) arr_obj = la.ndtest((2, 3)).astype(object) arr_str = la.ndtest((2, 3)).astype(str) big = la.ndtest((1000, 1000, 500)) From 1042c1ab6652137306b9bc8701b2a79e5656a96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 11 Oct 2019 14:47:09 +0200 Subject: [PATCH 3/7] renamed scalar to array_scalar for clarity --- larray_editor/tests/test_api_larray.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/larray_editor/tests/test_api_larray.py b/larray_editor/tests/test_api_larray.py index c0ae484..1742f29 100644 --- a/larray_editor/tests/test_api_larray.py +++ b/larray_editor/tests/test_api_larray.py @@ -99,7 +99,7 @@ def make_demo(width=20, ball_radius=5, path_radius=5, steps=30): demo = make_demo(9, 2.5, 1.5) sphere = make_sphere(9, 4) extreme_array = la.Array([-la.inf, -1, 0, la.nan, 1, la.inf]) -scalar = la.Array(0) +array_scalar = la.Array(0) arr_empty = la.Array([]) arr_empty_2d = la.Array([[], []]) arr_obj = la.ndtest((2, 3)).astype(object) From 2ec38972531c02998fc0003820917460a302e192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Thu, 10 Oct 2019 17:28:13 +0200 Subject: [PATCH 4/7] fixed code to display plots given as arrays of plotting axes (as returned by .plot(subplots=True)) * avoid an exception whenever we try to display any empty sequence (whether it contains plots or not) * avoid copying the whole sequence just to get the first element for non array sequences. This loose the ability to display plots hidden in nested sequences (instead of ndarrays) but I am unsure doing that even for simple sequences is useful anyway --- doc/source/changes/version_0_32_2.rst.inc | 4 ++-- larray_editor/editor.py | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/source/changes/version_0_32_2.rst.inc b/doc/source/changes/version_0_32_2.rst.inc index c4533eb..61f6f57 100644 --- a/doc/source/changes/version_0_32_2.rst.inc +++ b/doc/source/changes/version_0_32_2.rst.inc @@ -1,4 +1,4 @@ -.. py:currentmodule:: larray_editor +.. py:currentmodule:: larray_editor Syntax changes ^^^^^^^^^^^^^^ @@ -38,4 +38,4 @@ Miscellaneous improvements Fixes ^^^^^ -* fixed something (closes :editor_issue:`1`). +* fixed spurious warning in the console when an expression results in an empty sequence (array, list, tuple). diff --git a/larray_editor/editor.py b/larray_editor/editor.py index 7e850d5..8af812b 100644 --- a/larray_editor/editor.py +++ b/larray_editor/editor.py @@ -694,15 +694,24 @@ def ipython_cell_executed(self): # last command. Which means that if the last command did not produce any output, _ is not modified. cur_output = user_ns['_oh'].get(cur_input_num) if cur_output is not None: + if 'inline' not in matplotlib.get_backend(): + if isinstance(cur_output, np.ndarray) and cur_output.size > 0: + first_output = cur_output.flat[0] + if isinstance(first_output, matplotlib.axes.Subplot): + show_figure(self, first_output.figure) + # we use a different path for sequences than for arrays to avoid copying potentially + # big non-array sequences using np.ravel(). This code does not support nested sequences, + # but I am already unsure supporting simple non-array sequences is useful. + elif isinstance(cur_output, collections.Sequence) and len(cur_output) > 0: + first_output = cur_output[0] + if isinstance(first_output, matplotlib.axes.Subplot): + show_figure(self, first_output.figure) + elif isinstance(cur_output, matplotlib.axes.Subplot): + show_figure(self, cur_output.figure) + if self._display_in_grid('', cur_output): self.view_expr(cur_output) - if isinstance(cur_output, collections.Iterable): - cur_output = np.ravel(cur_output)[0] - - if isinstance(cur_output, matplotlib.axes.Subplot) and 'inline' not in matplotlib.get_backend(): - show_figure(self, cur_output.figure) - def on_selection_changed(self): selected = self._listwidget.selectedItems() if selected: From 7132be6ee66d387f9ba6080c738598c15437a8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Tue, 5 Nov 2019 10:19:59 +0100 Subject: [PATCH 5/7] fixed displaying all nan arrays --- doc/source/changes/version_0_32_2.rst.inc | 39 ++--------------------- larray_editor/tests/test_api_larray.py | 3 +- larray_editor/utils.py | 2 +- 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/doc/source/changes/version_0_32_2.rst.inc b/doc/source/changes/version_0_32_2.rst.inc index 61f6f57..fb03061 100644 --- a/doc/source/changes/version_0_32_2.rst.inc +++ b/doc/source/changes/version_0_32_2.rst.inc @@ -1,41 +1,8 @@ -.. py:currentmodule:: larray_editor - -Syntax changes -^^^^^^^^^^^^^^ - -* renamed ``MappingEditor.old_method_name()`` to :py:obj:`MappingEditor.new_method_name()` (closes :editor_issue:`1`). - -* renamed ``old_argument_name`` argument of :py:obj:`MappingEditor.method_name()` to ``new_argument_name``. - - -Backward incompatible changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* other backward incompatible changes - - -New features -^^^^^^^^^^^^ - -* added a feature (see the :ref:`miscellaneous section ` for details). - -* added another feature in the editor (closes :editor_issue:`1`). - - .. note:: - - - It works for foo bar ! - - It does not work for foo baz ! - - -.. _misc_editor: - -Miscellaneous improvements -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* improved something. - +.. py:currentmodule:: larray_editor Fixes ^^^^^ * fixed spurious warning in the console when an expression results in an empty sequence (array, list, tuple). + +* fixed displaying arrays entirely filled with NaN. diff --git a/larray_editor/tests/test_api_larray.py b/larray_editor/tests/test_api_larray.py index 1742f29..b889ffa 100644 --- a/larray_editor/tests/test_api_larray.py +++ b/larray_editor/tests/test_api_larray.py @@ -72,7 +72,7 @@ # test isssue #35 arr7 = la.from_lists([['a', 1, 2, 3], - [ '', 1664780726569649730, -9196963249083393206, -7664327348053294350]]) + [ '', 1664780726569649730, -9196963249083393206, -7664327348053294350]]) def make_circle(width=20, radius=9): @@ -100,6 +100,7 @@ def make_demo(width=20, ball_radius=5, path_radius=5, steps=30): sphere = make_sphere(9, 4) extreme_array = la.Array([-la.inf, -1, 0, la.nan, 1, la.inf]) array_scalar = la.Array(0) +arr_all_nan = la.Array([la.nan, la.nan]) arr_empty = la.Array([]) arr_empty_2d = la.Array([[], []]) arr_obj = la.ndtest((2, 3)).astype(object) diff --git a/larray_editor/utils.py b/larray_editor/utils.py index 32f95fd..9427b6e 100644 --- a/larray_editor/utils.py +++ b/larray_editor/utils.py @@ -539,7 +539,7 @@ def scale_to_01range(value, vmin, vmax): array([ 0. , 1. , 0.5, 0. , 0.1, 1. ]) """ if hasattr(value, 'shape') and value.shape: - if vmin == vmax: + if (np.isnan(vmin) and np.isnan(vmax)) or (vmin == vmax): return np.where(np.isnan(value), np.nan, 0) else: assert vmin < vmax From 09d06f1b9fb54ec391190cf51536ce3b789742a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Tue, 31 Mar 2020 12:12:04 +0200 Subject: [PATCH 6/7] bump version to 0.32.2 --- condarecipe/larray-editor/larray-editor.json | 2 +- condarecipe/larray-editor/meta.yaml | 4 ++-- larray_editor/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/condarecipe/larray-editor/larray-editor.json b/condarecipe/larray-editor/larray-editor.json index 3052aa6..aafd073 100644 --- a/condarecipe/larray-editor/larray-editor.json +++ b/condarecipe/larray-editor/larray-editor.json @@ -9,7 +9,7 @@ }, { "name": "LArray Documentation", - "webbrowser": "http://larray.readthedocs.io/en/0.32.1", + "webbrowser": "http://larray.readthedocs.io/en/0.32.2", "icon": "${MENU_DIR}/larray-help.ico" }, { diff --git a/condarecipe/larray-editor/meta.yaml b/condarecipe/larray-editor/meta.yaml index 01204ee..e527745 100644 --- a/condarecipe/larray-editor/meta.yaml +++ b/condarecipe/larray-editor/meta.yaml @@ -1,9 +1,9 @@ package: name: larray-editor - version: 0.32.2-dev + version: 0.32.2 source: - git_tag: 0.32.2-dev + git_tag: 0.32.2 git_url: https://github.com/larray-project/larray-editor.git # git_tag: master # git_url: file://c:/Users/gdm/devel/larray-editor/.git diff --git a/larray_editor/__init__.py b/larray_editor/__init__.py index ad0be5e..18cb03b 100644 --- a/larray_editor/__init__.py +++ b/larray_editor/__init__.py @@ -2,4 +2,4 @@ from larray_editor.api import * -__version__ = '0.32.2-dev' +__version__ = '0.32.2' diff --git a/setup.py b/setup.py index 29a858f..60933eb 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def readlocal(fname): DISTNAME = 'larray-editor' -VERSION = '0.32.2-dev' +VERSION = '0.32.2' AUTHOR = 'Gaetan de Menten, Geert Bryon, Johan Duyck, Alix Damman' AUTHOR_EMAIL = 'gdementen@gmail.com' DESCRIPTION = "Graphical User Interface for LArray library" From 1be0aff40a83ac174398a3bab73b87a28aa3469b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Tue, 31 Mar 2020 12:12:16 +0200 Subject: [PATCH 7/7] update release date for 0.32.2 --- doc/source/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 7f27fe7..66c8854 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -4,7 +4,7 @@ Change log Version 0.32.2 ============== -In development. +Released on 2020-03-31. .. include:: ./changes/version_0_32_2.rst.inc