From 86c835cc6e1c748568a618dde84014b1a08ce4ab Mon Sep 17 00:00:00 2001 From: AndresOrtegaGuerrero Date: Thu, 30 Nov 2023 10:11:39 +0000 Subject: [PATCH] checks if any element in the array returned by get_tags() is non-zero --- src/aiidalab_qe/common/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiidalab_qe/common/widgets.py b/src/aiidalab_qe/common/widgets.py index 8360ce783..afb7b6b88 100644 --- a/src/aiidalab_qe/common/widgets.py +++ b/src/aiidalab_qe/common/widgets.py @@ -566,7 +566,7 @@ def _add_tags(self, _=None): else: selection = string_range_to_list(self.atom_selection.value)[0] new_structure = deepcopy(self.structure) - if new_structure.get_tags() == []: + if not new_structure.get_tags().any(): new_tags = np.zeros(len(new_structure)) else: new_tags = new_structure.get_tags()