From 5949bdffda19c91bf439c70dcb90ac6d3815b119 Mon Sep 17 00:00:00 2001 From: Edan Bainglass <45081142+edan-bainglass@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:28:50 +0100 Subject: [PATCH] Fix process-node-related bugs (#967) This PR handles a couple of bugs related to the process node, specifically loading node views and managing the process state. --- src/aiidalab_qe/app/result/__init__.py | 2 ++ src/aiidalab_qe/common/panel.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/aiidalab_qe/app/result/__init__.py b/src/aiidalab_qe/app/result/__init__.py index faa9ec8f..1f07f1fc 100644 --- a/src/aiidalab_qe/app/result/__init__.py +++ b/src/aiidalab_qe/app/result/__init__.py @@ -189,6 +189,8 @@ def _update_node_view(self, nodes, refresh=False): self.node_view_container.children = [self.node_view_loading_message] self.node_view = self._create_workchain_viewer(node) self.node_views[node.uuid] = self.node_view + else: + self.node_view = ipw.HTML("No viewer available for this node.") self.node_view_container.children = [self.node_view] diff --git a/src/aiidalab_qe/common/panel.py b/src/aiidalab_qe/common/panel.py index 0620c382..f0d1f60f 100644 --- a/src/aiidalab_qe/common/panel.py +++ b/src/aiidalab_qe/common/panel.py @@ -556,7 +556,11 @@ def _get_child_process_status(self, child="this"): """ def _get_child_state_and_exit_message(self, child="this"): - if not (node := self._fetch_child_process_node(child)): + if not ( + (node := self._fetch_child_process_node(child)) + and hasattr(node, "process_state") + and node.process_state + ): return "queued", None if node.is_failed: return "failed", node.exit_message