-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process_state
is not always there when we probe it
#657
Comments
@danielhollas @AndresOrtegaGuerrero @superstar54 let me know what you think. |
Sounds reasonable to me, thanks! I'd start with the fix in aiida-core since that might inform the fix in AWB, such as...
Sounds reasonable! 👍 Thank you for a very clear write up and for discovering this! |
Look at the @property
def process_state(self) -> Optional[ProcessState]:
"""Return the process state
:returns: the process state instance of ProcessState enum
"""
state = self.base.attributes.get(self.PROCESS_STATE_KEY, None)
if state is None:
return state
return ProcessState(state) The condition can simplified to: if process_node.process_state is not None: I guess? Meanwhile, I think the |
In
NodesTreeWidget._update_tree_node
, we call AiiDA'scalc_info
CLI command, which in turn tries to doprocess_state = node.process_state.value.capitalize()
, which will raise an exception ifprocess_state
isNone
. When using theNodesTreeWidget
as part of theProcessMonitor
, I believe the exception will cause the monitor to disable future tree updates.I recommend a guard in the CLI command for the next AiiDA release. In the meantime, perhaps we bail on the update if there's not yet a process state.
Not sure if we need the
hasattr
part, but I suppose it doesn't hurt. Also, the check is boolean in general, not specificallyis not None
, assuming that bailing on empty states is also okay. Correct me if I'm wrong. Though I don't think we can have empty states, asProcessState
is anEnum
.The text was updated successfully, but these errors were encountered: