Skip to content

"len() of unsized object" exception when trying to display "scalar" Group #313

Closed

Description

@gdementen

Typing:

>>> la.Axis('age=0..3')[2]

in the console leads to an error box with the following traceback :

Traceback (most recent call last):
  File "C:\usr\devel\larray-editor\larray_editor\editor.py", line 1044, in ipython_cell_executed
  File "C:\usr\devel\larray-editor\larray_editor\editor.py", line 887, in select_list_item
    self.set_current_array(self.data[to_display], to_display)
  File "C:\usr\devel\larray-editor\larray_editor\editor.py", line 1131, in set_current_array
    # FIXME: we should never store the current_array but current_adapter instead
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\usr\devel\larray-editor\larray_editor\arraywidget.py", line 1888, in set_data
    self.set_data_adapter(data_adapter, frac_digits)
  File "C:\usr\devel\larray-editor\larray_editor\arraywidget.py", line 1914, in set_data_adapter
    self._set_models_adapter()
  File "C:\usr\devel\larray-editor\larray_editor\arraywidget.py", line 1872, in _set_models_adapter
    self.model_axes.set_adapter(self.data_adapter)
  File "C:\usr\devel\larray-editor\larray_editor\arraymodel.py", line 211, in set_adapter
    self._get_current_data()
  File "C:\usr\devel\larray-editor\larray_editor\arraymodel.py", line 494, in _get_current_data
    max_row, max_col = self.adapter.shape2d()
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\usr\devel\larray-editor\larray_editor\arrayadapter.py", line 1276, in shape2d
    return len(self.data), 1
           ^^^^^^^^^^^^^^
  File "C:\usr\devel\larray\larray\core\group.py", line 896, in __len__
    raise TypeError(f'len() of unsized object ({value})')
TypeError: len() of unsized object (2)

Activity

  1. added this to the 0.35.1 milestone on Mar 19, 2026
  2. self-assigned this
    on Mar 19, 2026
  3. gdementen commented on Mar 19, 2026

    @gdementen
    CollaboratorAuthor

    This bug is in fact due to larray-project/larray#1174 but since that issue is not fixable AFAICT, we need to support broken Collection instances in the adapter.

  4. added 3 commits that reference this issue on Mar 20, 2026
    4db98f2
    3161eda
    79b3cee
  5. added a commit that references this issue on Mar 26, 2026
    655fa93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions