Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/aiidalab_mlip/steps/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ def update_codes(self, _: ipw.Button | None = None) -> None:
self.code.options = code_labels

if code_labels:
self.code.value = code_labels[0]
if "janus" in code_labels:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very minor, but when you have 'feff' also installed the MLIP app defaults to that if this fix is not in place.

self.code.value = "janus"
elif any("janus" in c for c in code_labels):
self.code.value = next(c for c in code_labels if "janus" in c)
else:
self.code.value = code_labels[0]

def update_models(self, _: ipw.Button | None = None) -> None:
"""Update the list of available models."""
Expand Down
12 changes: 10 additions & 2 deletions src/aiidalab_mlip/steps/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ def _refresh_process_list(self) -> None:
options = []

for pk, ctime, label, _state, exit_status in results:
status_icon = "OK" if exit_status == 0 else "ERR" if exit_status else "RUN"
if exit_status == 0:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need some guard like this, otherwise you get

Calculation exited with status: None

For things that are still running. There might be a neater fix though

status_icon = "OK"
elif _state in ("created", "waiting", "running"):
status_icon = "RUN"
else:
status_icon = f"ERR ({exit_status})"
time_str = ctime.strftime("%Y-%m-%d %H:%M")

# Add to select options
Expand Down Expand Up @@ -177,7 +182,10 @@ def _on_load_click(self, _button: ipw.Button | None = None) -> None:
self.node_tree.value = node.uuid

# Check if calculation finished successfully
if node.exit_status != 0:
if not node.is_finished:
self.status.warning(f"Calculation is currently {node.process_state.value}...")
return
if node.exit_status not in (0, None):
self.status.failure(f"Calculation exited with status: {node.exit_status}")
return

Expand Down
Loading