Skip to content

Commit

Permalink
Move pseudo installer to common to avoid app load
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Oct 21, 2023
1 parent 2fd4ab5 commit f718271
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/aiidalab_qe/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import click

from aiidalab_qe.app.submission.sssp import install as setup_sssp
from aiidalab_qe.common.setup_codes import codes_are_setup
from aiidalab_qe.common.setup_codes import install as install_qe_codes
from aiidalab_qe.common.setup_pseudos import install as setup_pseudos


@click.group()
Expand All @@ -26,11 +26,11 @@ def install_qe(force):


@cli.command()
def install_sssp():
def install_pseudos():
try:
for msg, _ in setup_sssp():
for msg, _ in setup_pseudos():
click.echo(msg)
click.secho("SSSP pseudo potentials are installed!", fg="green")
click.secho("Pseudopotentials are installed!", fg="green")
except Exception as error:
raise click.ClickException(f"Failed to set up pseudo potentials: {error}")

Expand Down
4 changes: 2 additions & 2 deletions src/aiidalab_qe/app/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
from aiidalab_qe.app.parameters import DEFAULT_PARAMETERS
from aiidalab_qe.app.utils import get_entry_items
from aiidalab_qe.common.setup_codes import QESetupWidget
from aiidalab_qe.common.setup_pseudos import PseudosInstallWidget
from aiidalab_qe.workflows import QeAppWorkChain

from .resource import ParallelizationSettings, ResourceSelectionWidget
from .sssp import SSSPInstallWidget

PROTOCOL_PSEUDO_MAP = {
"fast": "SSSP/1.2/PBE/efficiency",
Expand Down Expand Up @@ -110,7 +110,7 @@ def __init__(self, qe_auto_setup=True, **kwargs):
# in case that the installation was already triggered elsewhere, e.g.,
# by the start up scripts. The submission is blocked while the
# potentials are not yet installed.
self.sssp_installation_status = SSSPInstallWidget(auto_start=qe_auto_setup)
self.sssp_installation_status = PseudosInstallWidget(auto_start=qe_auto_setup)
self.sssp_installation_status.observe(self._update_state, ["busy", "installed"])
self.sssp_installation_status.observe(self._toggle_install_widgets, "installed")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def install():
)


class SSSPInstallWidget(ProgressBar):
class PseudosInstallWidget(ProgressBar):
installed = traitlets.Bool(allow_none=True).tag(readonly=True)
busy = traitlets.Bool().tag(readonly=True)
installing = traitlets.Bool().tag(readonly=True)
Expand Down

0 comments on commit f718271

Please sign in to comment.