Skip to content

Commit

Permalink
Inject process pk to url on submission
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 19, 2024
1 parent 1aa0d8e commit 1074c59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 0 additions & 2 deletions qe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display\n",
"\n",
"from aiidalab_qe.app.wrapper import AppWrapperContoller, AppWrapperModel, AppWrapperView\n",
"\n",
"model = AppWrapperModel()\n",
Expand Down
17 changes: 14 additions & 3 deletions src/aiidalab_qe/app/submission/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import ipywidgets as ipw
import traitlets as tl
from IPython.display import Javascript, display

from aiida import orm
from aiida.engine import ProcessBuilderNamespace, submit
Expand Down Expand Up @@ -91,9 +92,13 @@ def update_process_label(self):
{"properties": []},
)

soc_parameters = self.input_parameters["advanced"]["pw"]["parameters"][
"SYSTEM"
].get("lspinorb", False)
soc_parameters = (
self.input_parameters.get("advanced", {})
.get("pw", {})
.get("parameters", {})
.get("SYSTEM", {})
.get("lspinorb", False)
)

soc_info = "spin-orbit coupling" if soc_parameters else ""

Expand Down Expand Up @@ -231,6 +236,12 @@ def _submit(self):
)
self.process_node = process_node

self._update_url()

def _update_url(self):
pk = self.process_node.pk
display(Javascript(f"window.history.pushState(null, '', '?pk={pk}');"))

def _link_model(self, model: ResourceSettingsModel):
for dependency in model.dependencies:
dependency_parts = dependency.split(".")
Expand Down

0 comments on commit 1074c59

Please sign in to comment.