Repository navigation
Fix runtime bugs in model loading, singlepoint submission, and results views - #12
Conversation
| class SummaryViewer(ipw.VBox): | ||
| def __init__(self, node, **kwargs) -> None: | ||
|
|
||
| if not hasattr(node, "outputs") or "results_dict" not in node.outputs: |
There was a problem hiding this comment.
|
|
||
| try: | ||
| model_str = ModelData.from_uri(model_uri, architecture=arch, cache_dir="mlips") | ||
| model_str = ModelData.from_uri(model_uri, architecture=arch, cache_dir=Path.home() / ".cache" / "mlips") |
There was a problem hiding this comment.
| def _try_load_model(self, arch: str) -> ModelData | None: | ||
|
|
||
| typ = self.model_type._titles[str(self.model_type.selected_index)] | ||
| typ = self.model_type.get_title(self.model_type.selected_index) |
There was a problem hiding this comment.
| case "Single Point": | ||
| builder = Singlepoint.get_builder() | ||
| builder.properties = orm.List(list(task_parameters["properties"])) | ||
| props = task_parameters["properties"] |
There was a problem hiding this comment.
The current master of aiida-mlip takes a aiida.orm.List (https://github.com/stfc/aiida-mlip/blob/main/aiida_mlip/calculations/singlepoint.py)
|
is this still blocking? |
…reselect janus code
|
I'm just rebasing now after the version and phonon branches were merged. I think those took care of most of the issues tbh. Let me do an actual build of the whole thing a see if there are lingering runtime issues |
4a4cedc to
c0804a1
Compare
|
|
||
| if code_labels: | ||
| self.code.value = code_labels[0] | ||
| if "janus" in code_labels: |
There was a problem hiding this comment.
This is very minor, but when you have 'feff' also installed the MLIP app defaults to that if this fix is not in place.
|
|
||
| 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: |
There was a problem hiding this comment.
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
|
So the only two things left after rebasing are very minor and not blocking at all. |
While running the app against
ipywidgets 8and testing calculation workflows, I hit several runtime errors that broke the UI or blocked submissions.What broke and what changed
Tab._titlesremoved in ipywidgets 8 (model.py)Selecting a model tab threw an
AttributeErrorbecauseipywidgets 8dropped the internal_titlesdict. Switched toself.model_type.get_title(selected_index).Model cache path and code auto-selection (
model.py,prediction.py)ModelData.from_uriused a relativecache_dir="mlips", writing cache files into whatever working directory the notebook kernel happened to be in. Changed both calls toPath.home() / ".cache" / "mlips". Also updated the code dropdown to automatically pickjanusif it exists in the AiiDA profile, rather than whichever code sorted first.Singlepoint properties format (
run.py)The singlepoint calculation builder expects
propertiesas an AiiDAStr(comma-separated string), but was being passed anorm.List, which caused calculation submissions to fail.Handling in-progress or failed runs in results (
results.py,node_viewers.py)In
ResultsWizardStep, clicking on an active (waiting or running) calculation crashed becauseexit_statusisNoneuntil the process finishes. Added anis_finishedcheck before evaluating exit codes. InSummaryViewer, clicking a node that failed or was killed before writingresults_dictcaused aKeyError; it now prints the process state and exit status cleanly instead of crashing.Testing
pytest: 15 passed).