From 2248236582fa7636a7641298491ff5995d0516fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Thu, 26 Mar 2026 16:58:31 +0100 Subject: [PATCH 1/2] FIX: do not try to display a pytables.File if it is closed --- larray_editor/arrayadapter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/larray_editor/arrayadapter.py b/larray_editor/arrayadapter.py index 1a0a34a..4106056 100644 --- a/larray_editor/arrayadapter.py +++ b/larray_editor/arrayadapter.py @@ -2848,6 +2848,8 @@ class PyTablesFileAdapter(AbstractColumnarAdapter): _COLNAMES = ['Name'] def __init__(self, data, attributes): + if not data.isopen: + raise ValueError('file is already closed') super().__init__(data=data, attributes=attributes) def shape2d(self): From f9a8d4f026539a8dd2ab0b5db5c17e7da09d9750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20de=20Menten?= Date: Fri, 27 Mar 2026 12:07:45 +0100 Subject: [PATCH 2/2] FIX: display mixed-type Excel Sheet objects for each chunk, if the first value contains a number but other values contain text, it breaks --- doc/source/changes/version_0_35_1.rst.inc | 3 +++ larray_editor/arrayadapter.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/source/changes/version_0_35_1.rst.inc b/doc/source/changes/version_0_35_1.rst.inc index 0066145..c3ea7c6 100644 --- a/doc/source/changes/version_0_35_1.rst.inc +++ b/doc/source/changes/version_0_35_1.rst.inc @@ -69,6 +69,9 @@ Fixes * do not try to display Path objects which point to a file or directory which does not exist (closes :editor_issue:`317`). +* fixed (Excel) Sheet objects being only partially displayed when + the first value contains a number but other values contain text. + * fixed the mechanism writing warning/error messages happening during the editor initialization. The errors are now correctly written in the user TEMP directory / larray-editor-stderr.log \ No newline at end of file diff --git a/larray_editor/arrayadapter.py b/larray_editor/arrayadapter.py index 4106056..97db2ac 100644 --- a/larray_editor/arrayadapter.py +++ b/larray_editor/arrayadapter.py @@ -1805,8 +1805,11 @@ def open(cls, fpath): def close(self): self.data.close() - -none_to_empty_string = np.vectorize(lambda v: v if v is not None else '') +# we need to specify otypes explicitly here because otherwise np.vectorize +# will use the type of the first value (e.g. int64) for the resulting array and that breaks if it +# cannot hold subsequent values +none_to_empty_string = np.vectorize(lambda v: v if v is not None else '', + otypes=[object]) @adapter_for('larray.inout.xw_excel.Sheet')