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 #654

Merged
merged 4 commits into from
Apr 3, 2024
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ repos:
exclude: tests

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.27.3
rev: 0.28.1
hooks:
- id: check-github-workflows

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
rev: 1.8.5
hooks:
- id: nbqa-pyupgrade
args: [--py38-plus]
Expand All @@ -36,13 +36,13 @@ repos:
args: [--ignore=E402]

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.11
rev: v0.3.4
hooks:
# Run the linter.
- id: ruff
Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Package for the AiiDAlab QE app version.
Plugin (workflow) version will be read from the plugin's __init__.py file.
"""

from aiidalab_qe.version import __version__

__all__ = [
Expand Down
3 changes: 1 addition & 2 deletions src/aiidalab_qe/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""For running the app from the command line used for post_install script.
"""
"""For running the app from the command line used for post_install script."""

from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Authors: AiiDAlab team
"""

from __future__ import annotations

import ipywidgets as ipw
Expand Down
43 changes: 22 additions & 21 deletions src/aiidalab_qe/app/configuration/advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Authors: AiiDAlab team
"""

import os

import ipywidgets as ipw
Expand Down Expand Up @@ -267,40 +268,40 @@ def get_panel_value(self):
parameters["pseudo_family"] = self.pseudo_family_selector.value
if self.pseudo_setter.pseudos:
parameters["pw"]["pseudos"] = self.pseudo_setter.pseudos
parameters["pw"]["parameters"]["SYSTEM"][
"ecutwfc"
] = self.pseudo_setter.ecutwfc
parameters["pw"]["parameters"]["SYSTEM"][
"ecutrho"
] = self.pseudo_setter.ecutrho
parameters["pw"]["parameters"]["SYSTEM"]["ecutwfc"] = (
self.pseudo_setter.ecutwfc
)
parameters["pw"]["parameters"]["SYSTEM"]["ecutrho"] = (
self.pseudo_setter.ecutrho
)
# if override is not ticked, use the default value
parameters["pw"]["parameters"]["SYSTEM"]["tot_charge"] = self.total_charge.value

if self.van_der_waals.value in ["none", "ts-vdw"]:
parameters["pw"]["parameters"]["SYSTEM"][
"vdw_corr"
] = self.van_der_waals.value
parameters["pw"]["parameters"]["SYSTEM"]["vdw_corr"] = (
self.van_der_waals.value
)
else:
parameters["pw"]["parameters"]["SYSTEM"]["vdw_corr"] = "dft-d3"
parameters["pw"]["parameters"]["SYSTEM"][
"dftd3_version"
] = self.dftd3_version[self.van_der_waals.value]
parameters["pw"]["parameters"]["SYSTEM"]["dftd3_version"] = (
self.dftd3_version[self.van_der_waals.value]
)

# there are two choose, use link or parent
if self.spin_type == "collinear":
parameters[
"initial_magnetic_moments"
] = self.magnetization.get_magnetization()
parameters["initial_magnetic_moments"] = (
self.magnetization.get_magnetization()
)
parameters["kpoints_distance"] = self.value.get("kpoints_distance")
if self.electronic_type == "metal":
# smearing type setting
parameters["pw"]["parameters"]["SYSTEM"][
"smearing"
] = self.smearing.smearing_value
parameters["pw"]["parameters"]["SYSTEM"]["smearing"] = (
self.smearing.smearing_value
)
# smearing degauss setting
parameters["pw"]["parameters"]["SYSTEM"][
"degauss"
] = self.smearing.degauss_value
parameters["pw"]["parameters"]["SYSTEM"]["degauss"] = (
self.smearing.degauss_value
)

return parameters

Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/configuration/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Authors: AiiDAlab team
"""

import ipywidgets as ipw
from aiida_quantumespresso.common.types import RelaxType

Expand Down
6 changes: 3 additions & 3 deletions src/aiidalab_qe/app/result/summary_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def generate_report_parameters(qeapp_wc):
)["bands_kpoints_distance"]

if "pdos" in qeapp_wc.inputs:
report[
"nscf_kpoints_distance"
] = qeapp_wc.inputs.pdos.nscf.kpoints_distance.value
report["nscf_kpoints_distance"] = (
qeapp_wc.inputs.pdos.nscf.kpoints_distance.value
)
return report


Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Authors: AiiDAlab team
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/submission/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Authors: AiiDAlab team
"""

import ipywidgets as ipw


Expand Down
4 changes: 2 additions & 2 deletions src/aiidalab_qe/common/bandpdoswidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,8 @@ def get_bands_labeling(bandsdata: dict) -> list:
UNICODE_SYMBOL = {
"GAMMA": "\u0393",
"DELTA": "\u0394",
"LAMBDA": "\u039B",
"SIGMA": "\u03A3",
"LAMBDA": "\u039b",
"SIGMA": "\u03a3",
"EPSILON": "\u0395",
}
paths = bandsdata.get("paths")
Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/common/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

AiiDAlab Team
"""

import ipywidgets as ipw

DEFAULT_PARAMETERS = {}
Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/common/process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Widgets related to process management."""

from dataclasses import make_dataclass

import ipywidgets as ipw
Expand Down
3 changes: 1 addition & 2 deletions src/aiidalab_qe/plugins/bands/result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Bands results view widgets
"""Bands results view widgets"""

"""
from aiidalab_qe.common.bandpdoswidget import BandPdosWidget
from aiidalab_qe.common.panel import ResultPanel

Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/plugins/bands/setting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""Panel for Bands plugin."""

import ipywidgets as ipw

from aiidalab_qe.common.panel import Panel
Expand Down
4 changes: 1 addition & 3 deletions src/aiidalab_qe/plugins/pdos/result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""PDOS results view widgets

"""
"""PDOS results view widgets"""

from aiidalab_qe.common.bandpdoswidget import BandPdosWidget
from aiidalab_qe.common.panel import ResultPanel
Expand Down
1 change: 1 addition & 0 deletions src/aiidalab_qe/plugins/pdos/setting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""Panel for Pdos plugin."""

import ipywidgets as ipw
import traitlets as tl
from aiida import orm
Expand Down
3 changes: 1 addition & 2 deletions src/aiidalab_qe/plugins/xas/result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""XAS results view widgets
"""XAS results view widgets"""

"""
import base64
import hashlib
from typing import Callable
Expand Down
3 changes: 1 addition & 2 deletions src/aiidalab_qe/plugins/xas/setting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""Panel for XAS plugin.
"""Panel for XAS plugin."""

"""
import os
import tarfile
from importlib import resources
Expand Down
3 changes: 1 addition & 2 deletions src/aiidalab_qe/plugins/xps/result.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""XPS results view widgets
"""XPS results view widgets"""

"""
import ipywidgets as ipw

from aiidalab_qe.common.panel import ResultPanel
Expand Down
3 changes: 1 addition & 2 deletions src/aiidalab_qe/plugins/xps/setting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""Panel for XPS plugin.
"""Panel for XPS plugin."""

"""
import ipywidgets as ipw
import traitlets as tl
from aiida.orm import Group, QueryBuilder, StructureData
Expand Down
6 changes: 3 additions & 3 deletions tests/test_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def test_set_configuration_parameters():
new_parameters = wg.get_configuration_parameters()
assert parameters == new_parameters
# test pseudodojo
parameters["advanced"][
"pseudo_family"
] = f"PseudoDojo/{PSEUDODOJO_VERSION}/PBEsol/SR/standard/upf"
parameters["advanced"]["pseudo_family"] = (
f"PseudoDojo/{PSEUDODOJO_VERSION}/PBEsol/SR/standard/upf"
)
wg.set_configuration_parameters(parameters)
new_parameters = wg.get_configuration_parameters()
assert parameters == new_parameters
Expand Down
Loading