Skip to content

Commit

Permalink
Install sssp and set up qe on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Oct 30, 2024
1 parent e4a225d commit 8f68590
Showing 1 changed file with 39 additions and 34 deletions.
73 changes: 39 additions & 34 deletions src/aiidalab_qe/app/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def __init__(self, model: SubmissionModel, qe_auto_setup=True, **kwargs):

self.rendered = False

self._install_sssp(qe_auto_setup)
self._set_up_qe(qe_auto_setup)

def render(self):
if self.rendered:
return
Expand Down Expand Up @@ -139,40 +142,6 @@ def render(self):
)
self.submit_button.on_click(self._on_submission)

self.sssp_installation = PseudosInstallWidget(auto_start=False)
ipw.dlink(
(self.sssp_installation, "busy"),
(self._model, "installing_sssp"),
)
ipw.dlink(
(self.sssp_installation, "installed"),
(self._model, "installing_sssp"),
lambda installed: not installed,
)
ipw.dlink(
(self.sssp_installation, "installed"),
(self._model, "sssp_installed"),
)
if self.qe_auto_setup:
self.sssp_installation.refresh()

self.qe_setup = QESetupWidget(auto_start=False)
ipw.dlink(
(self.qe_setup, "busy"),
(self._model, "installing_qe"),
)
ipw.dlink(
(self.qe_setup, "installed"),
(self._model, "installing_qe"),
lambda installed: not installed,
)
ipw.dlink(
(self.qe_setup, "installed"),
(self._model, "qe_installed"),
)
if self.qe_auto_setup:
self.qe_setup.refresh()

self.submission_blocker_messages = ipw.HTML()
ipw.dlink(
(self._model, "submission_blocker_messages"),
Expand Down Expand Up @@ -341,3 +310,39 @@ def _update_state(self, _=None):
self.state = self.State.READY
else:
self.state = self.state.CONFIGURED

def _install_sssp(self, qe_auto_setup):
self.sssp_installation = PseudosInstallWidget(auto_start=False)
ipw.dlink(
(self.sssp_installation, "busy"),
(self._model, "installing_sssp"),
)
ipw.dlink(
(self.sssp_installation, "installed"),
(self._model, "installing_sssp"),
lambda installed: not installed,
)
ipw.dlink(
(self.sssp_installation, "installed"),
(self._model, "sssp_installed"),
)
if qe_auto_setup:
self.sssp_installation.refresh()

def _set_up_qe(self, qe_auto_setup):
self.qe_setup = QESetupWidget(auto_start=False)
ipw.dlink(
(self.qe_setup, "busy"),
(self._model, "installing_qe"),
)
ipw.dlink(
(self.qe_setup, "installed"),
(self._model, "installing_qe"),
lambda installed: not installed,
)
ipw.dlink(
(self.qe_setup, "installed"),
(self._model, "qe_installed"),
)
if qe_auto_setup:
self.qe_setup.refresh()

0 comments on commit 8f68590

Please sign in to comment.