8000 prevent "filters" label from appearing for scalar (0D) arrays · gdementen/larray-editor@295e610 · GitHub
[go: up one dir, main page]

Skip to content

Commit 295e610

Browse files
committed
prevent "filters" label from appearing for scalar (0D) arrays
1 parent 69b26a4 commit 295e610

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

larray_editor/arraywidget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,8 @@ def set_data(self, data=None, bg_value=None):
766766
# update filters
767767
filters_layout = self.filters_layout
768768
clear_layout(filters_layout)
769-
# len(axes) > 0 is not good because we can have len 0 axes
770-
if la_data.size > 0:
769+
# data.size > 0 to avoid arrays with length 0 axes and len(axes) > 0 to avoid scalars (scalar.size == 1)
770+
if la_data.size > 0 and len(axes) > 0:
771771
filters_layout.addWidget(QLabel(_("Filters")))
772772
for axis, display_name in zip(axes, display_names):
773773
filters_layout.addWidget(QLabel(display_name))

0 commit comments

Comments
 (0)
0