Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #378

Merged
merged 2 commits into from
Apr 6, 2023
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: yamlfmt

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
Expand All @@ -39,7 +39,7 @@ repos:
args: [--profile, black, --filter-files]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.20.0
rev: 0.22.0
hooks:
- id: check-github-workflows

Expand Down
11 changes: 2 additions & 9 deletions aiidalab_qe/node_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@


class MinimalStructureViewer(ipw.VBox):

structure = Union([Instance(Atoms), Instance(Node)], allow_none=True)
_displayed_structure = Instance(Atoms, allow_none=True, read_only=True)

background = Unicode()
supercell = List(Int)

def __init__(self, structure, *args, **kwargs):

self._viewer = nglview.NGLWidget()
self._viewer.camera = "orthographic"
self._viewer.stage.set_parameters(mouse_preset="pymol")
Expand Down Expand Up @@ -146,7 +144,8 @@ def _projections_curated(
):
"""Collect the data from ProjectionData and parse it as dos list which can be
understand by bandsplot widget. `group_dos_by` is for which tag to be grouped, by atom or by orbital name.
The spin_type is used to invert all the y values of pdos to be shown as spin down pdos and to set label."""
The spin_type is used to invert all the y values of pdos to be shown as spin down pdos and to set label.
"""
_pdos = {}

for orbital, pdos, energy in projections.get_pdos():
Expand Down Expand Up @@ -289,7 +288,6 @@ def __init__(self, caption, body, *args, **kwargs):

class SummaryView(ipw.VBox):
def __init__(self, wc_node, **kwargs):

self.wc_node = wc_node

def _fmt_yes_no(truthy):
Expand All @@ -315,7 +313,6 @@ def _fmt_yes_no(truthy):


class WorkChainOutputs(ipw.VBox):

_busy = traitlets.Bool(read_only=True)

def __init__(self, node, export_dir=None, **kwargs):
Expand All @@ -340,7 +337,6 @@ def __init__(self, node, export_dir=None, **kwargs):
self._download_button_container = ipw.Box([self._download_archive_button])

if node.exit_status != 0:

title = ipw.HTML(
f"<h4>Workflow failed with exit status [{ node.exit_status }]</h4>"
)
Expand Down Expand Up @@ -383,7 +379,6 @@ def _observe_busy(self, change):
]

def _download_archive(self, _):

fn_archive = self.export_dir.joinpath(str(self.node.uuid)).with_suffix(".zip")
fn_lockfile = fn_archive.with_suffix(".lock")

Expand Down Expand Up @@ -496,7 +491,6 @@ def _write_calcjob_io(calcjob: CalcJobNode, folder: Path) -> None:
pseudo_folder.mkdir(exist_ok=True)

for _, pseudo in calcjob.inputs.pseudos.items():

pseudo_path = pseudo_folder / pseudo.filename

with pseudo_path.open("w") as handle:
Expand All @@ -512,7 +506,6 @@ def _write_calcjob_io(calcjob: CalcJobNode, folder: Path) -> None:

@register_viewer_widget("process.workflow.workchain.WorkChainNode.")
class WorkChainViewer(ipw.VBox):

_results_shown = traitlets.Set()

def __init__(self, node, **kwargs):
Expand Down
1 change: 0 additions & 1 deletion aiidalab_qe/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class WorkChainSelector(ipw.HBox):

# The PK of a 'aiida.workflows:quantumespresso.pw.bands' WorkChainNode.
value = traitlets.Int(allow_none=True)

Expand Down
2 changes: 0 additions & 2 deletions aiidalab_qe/pseudos.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class PseudoFamilySelector(ipw.VBox):

title = ipw.HTML(
"""<div style="padding-top: 0px; padding-bottom: 10px">
<h4>Accuracy and precision</h4></div>"""
Expand Down Expand Up @@ -54,7 +53,6 @@ class PseudoFamilySelector(ipw.VBox):
)

def __init__(self, **kwargs):

# Enable manual setting of the pseudopotential family
self.set_pseudo_family_prompt = ipw.HTML("<b>&nbsp;&nbsp;Override&nbsp;</b>")
self.set_pseudo_family = ipw.Checkbox(
Expand Down
2 changes: 0 additions & 2 deletions aiidalab_qe/setup_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def install(force=False):
)

if not qe_installed():

# First, install Quantum ESPRESSO.
yield "Installing QE..."
try:
Expand All @@ -158,7 +157,6 @@ def install(force=False):


class QESetupWidget(ipw.VBox):

installed = traitlets.Bool(allow_none=True).tag(readonly=True)
busy = traitlets.Bool().tag(readonly=True)
error = traitlets.Unicode().tag(readonly=True)
Expand Down
1 change: 0 additions & 1 deletion aiidalab_qe/sssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def install():


class SSSPInstallWidget(ProgressBar):

installed = traitlets.Bool(allow_none=True).tag(readonly=True)
busy = traitlets.Bool().tag(readonly=True)
installing = traitlets.Bool().tag(readonly=True)
Expand Down
11 changes: 0 additions & 11 deletions aiidalab_qe/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@


class WorkChainSettings(ipw.VBox):

structure_title = ipw.HTML(
"""<div style="padding-top: 0px; padding-bottom: 0px">
<h4>Structure</h4></div>"""
Expand Down Expand Up @@ -83,7 +82,6 @@ class WorkChainSettings(ipw.VBox):
)

def __init__(self, **kwargs):

# RelaxType: degrees of freedom in geometry optimization
self.relax_type = ipw.ToggleButtons(
options=[
Expand Down Expand Up @@ -179,7 +177,6 @@ def __init__(self, **kwargs):


class SmearingSettings(ipw.VBox):

smearing_description = ipw.HTML(
"""<p>
The smearing type and width is set by the chosen <b>protocol</b>.
Expand All @@ -194,7 +191,6 @@ class SmearingSettings(ipw.VBox):
smearing_default = traitlets.Unicode(default_value="cold")

def __init__(self, **kwargs):

self.override_protocol_smearing = ipw.Checkbox(
description="Override",
indent=False,
Expand Down Expand Up @@ -253,7 +249,6 @@ def set_smearing(self, _=None):


class KpointSettings(ipw.VBox):

kpoints_distance_description = ipw.HTML(
"""<div>
The k-points mesh density of the SCF calculation is set by the <b>protocol</b>.
Expand All @@ -265,7 +260,6 @@ class KpointSettings(ipw.VBox):
kpoints_distance_default = traitlets.Float(default_value=0.15)

def __init__(self, **kwargs):

self.override_protocol_kpoints = ipw.Checkbox(
description="Override",
indent=False,
Expand Down Expand Up @@ -305,7 +299,6 @@ def set_kpoints_distance(self, _=None):


class ConfigureQeAppWorkChainStep(ipw.VBox, WizardAppWidgetStep):

confirmed = traitlets.Bool()
previous_step_state = traitlets.UseEnum(WizardAppWidgetStep.State)
workchain_settings = traitlets.Instance(WorkChainSettings, allow_none=True)
Expand All @@ -314,7 +307,6 @@ class ConfigureQeAppWorkChainStep(ipw.VBox, WizardAppWidgetStep):
pseudo_family_selector = traitlets.Instance(PseudoFamilySelector, allow_none=True)

def __init__(self, **kwargs):

self.workchain_settings = WorkChainSettings()
self.workchain_settings.relax_type.observe(self._update_state, "value")
self.workchain_settings.bands_run.observe(self._update_state, "value")
Expand Down Expand Up @@ -565,7 +557,6 @@ def _observe_submission_blockers(self, change):
self._submission_blocker_messages.value = ""

def _identify_submission_blockers(self):

# Do not submit while any of the background setup processes are running.
if self.qe_setup_status.busy or self.sssp_installation_status.busy:
yield "Background setup processes must finish."
Expand Down Expand Up @@ -679,7 +670,6 @@ def _update_resources(self, change):
self.set_resource_defaults(load_code(change["new"]).computer)

def set_resource_defaults(self, computer=None):

if computer is None or computer.hostname == "localhost":
self.resources_config.num_nodes.disabled = True
self.resources_config.num_nodes.value = 1
Expand Down Expand Up @@ -901,7 +891,6 @@ def reset(self):


class ViewQeAppWorkChainStatusAndResultsStep(ipw.VBox, WizardAppWidgetStep):

process = traitlets.Unicode(allow_none=True)

def __init__(self, **kwargs):
Expand Down
5 changes: 0 additions & 5 deletions aiidalab_qe/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@


class RollingOutput(ipw.VBox):

style = (
"background-color: #253239; color: #cdd3df; line-height: normal; custom=test"
)
Expand Down Expand Up @@ -138,7 +137,6 @@ def __on_click(self, _):


class FilenameDisplayWidget(ipw.Box):

value = traitlets.Unicode()

def __init__(self, max_width=None, **kwargs):
Expand All @@ -162,7 +160,6 @@ def _observe_filename(self, change):


class LogOutputWidget(ipw.VBox):

filename = traitlets.Unicode()
value = traitlets.Unicode()

Expand Down Expand Up @@ -240,7 +237,6 @@ def _observe_value(self, change):


class CalcJobOutputFollower(traitlets.HasTraits):

calcjob_uuid = traitlets.Unicode(allow_none=True)
filename = traitlets.Unicode(allow_none=True)
output = traitlets.List(trait=traitlets.Unicode)
Expand Down Expand Up @@ -473,7 +469,6 @@ def __init__(self, description_layout=None, *args, **kwargs):
super().__init__([self._label, self._progress_bar], *args, **kwargs)

def _animate(self, refresh_rate=0.01):

v0 = self._progress_bar.value
t0 = time()

Expand Down