From ca101a8421e7e36636e02226ac839fdb22cdae74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Thu, 20 Jun 2024 16:23:51 +0200 Subject: [PATCH 1/2] bump version to 0.34.3-dev --- doc/source/changes.rst | 8 +++++ doc/source/changes/version_0_34_3.rst.inc | 41 +++++++++++++++++++++++ larray_editor/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 doc/source/changes/version_0_34_3.rst.inc diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 3387b72..dc305a6 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -1,6 +1,14 @@ Change log ########## +Version 0.34.3 +============== + +In development. + +.. include:: ./changes/version_0_34_3.rst.inc + + Version 0.34.2 ============== diff --git a/doc/source/changes/version_0_34_3.rst.inc b/doc/source/changes/version_0_34_3.rst.inc new file mode 100644 index 0000000..c4533eb --- /dev/null +++ b/doc/source/changes/version_0_34_3.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 e23cad5..684e726 100644 --- a/larray_editor/__init__.py +++ b/larray_editor/__init__.py @@ -1,3 +1,3 @@ from larray_editor.api import * # noqa: F403 -__version__ = '0.34.2' +__version__ = '0.34.3-dev' diff --git a/setup.py b/setup.py index baaec93..58d342e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def readlocal(fname): DISTNAME = 'larray-editor' -VERSION = '0.34.2' +VERSION = '0.34.3-dev' AUTHOR = 'Gaetan de Menten, Geert Bryon, Johan Duyck, Alix Damman' AUTHOR_EMAIL = 'gdementen@gmail.com' DESCRIPTION = "Graphical User Interface for LArray library" From fcf1bb32344e2631736e275358c1c04671fae322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Thu, 20 Jun 2024 16:35:51 +0200 Subject: [PATCH 2/2] FIX: modifying an array using .i/.points/.ipoints/.iflat now refreshes the view (fixes issue #269) --- doc/source/changes/version_0_34_3.rst.inc | 39 ++--------------------- larray_editor/editor.py | 8 ++--- 2 files changed, 7 insertions(+), 40 deletions(-) diff --git a/doc/source/changes/version_0_34_3.rst.inc b/doc/source/changes/version_0_34_3.rst.inc index c4533eb..be99fa5 100644 --- a/doc/source/changes/version_0_34_3.rst.inc +++ b/doc/source/changes/version_0_34_3.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. - - Fixes ^^^^^ -* fixed something (closes :editor_issue:`1`). +* changes made to arrays in the console using the "points" syntax (for example: `arr.points['a0,a1', 'b0,b1'] = 0`) + and the other special `.something[]` syntaxes were not detected by the viewer and thus not displayed (closes + :editor_issue:`269`). diff --git a/larray_editor/editor.py b/larray_editor/editor.py index ca7f706..857a8a6 100644 --- a/larray_editor/editor.py +++ b/larray_editor/editor.py @@ -75,7 +75,7 @@ REOPEN_LAST_FILE = object() assignment_pattern = re.compile(r'[^\[\]]+[^=]=[^=].+') -setitem_pattern = re.compile(r'(.+)\[.+\][^=]=[^=].+') +setitem_pattern = re.compile(r'(\w+)(\.i|\.iflat|\.points|\.ipoints)?\[.+\][^=]=[^=].+') history_vars_pattern = re.compile(r'_i?\d+') # XXX: add all scalars except strings (from numpy or plain Python)? # (long) strings are not handled correctly so should NOT be in this list @@ -695,9 +695,9 @@ def ipython_cell_executed(self): # 'In' and '_ih' point to the same object (but '_ih' is supposed to be the non-overridden one) cur_input_num = len(user_ns['_ih']) - 1 last_input = user_ns['_ih'][-1] - if setitem_pattern.match(last_input): - m = setitem_pattern.match(last_input) - varname = m.group(1) + setitem_match = setitem_pattern.match(last_input) + if setitem_match: + varname = setitem_match.group(1) # otherwise it should have failed at this point, but let us be sure if varname in clean_ns: if self._display_in_grid(varname, clean_ns[varname]):