Skip to content

Commit

Permalink
Merge branch 'main' into fix_605_hide_kill_button
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Apr 3, 2024
2 parents b2d149f + df1b7cf commit f222658
Show file tree
Hide file tree
Showing 25 changed files with 95 additions and 69 deletions.
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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# -- Project information -----------------------------------------------------

version = "v24.04.0a2"
version = "v24.04.0a3"
release = f"{version}-dev"
project = "Quantum ESPRESSO App"
copyright_first_year = "2023"
Expand Down
7 changes: 4 additions & 3 deletions docs/source/development/plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ Beside, you need to override the the following methods:
}
def set_panel_value(self, input_dict):
"""Set a dictionary with the input parameters for the plugin."""
"""Set the value of the widgets in the panel from the input dictionary.
This method is called when the user wants to reload the panel from the previous calculation,
or reset the panel to the default values."""
self.scale.value = input_dict.get("scale", 0.05)
self.npoint.value = input_dict.get("npoint", 5)
def reset(self):
"""Reset the input fields."""
self.scale.value = 0.05
self.npoint.value = 5
self.set_panel_value({"scale": 0.05, "npoint": 5})
Result
-----------------------
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = aiidalab_qe
version = 24.4.0a2
version = 24.4.0a3
description = Package for the AiiDAlab QE app
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down Expand Up @@ -66,7 +66,7 @@ categories =
quantum

[bumpver]
current_version = "v24.04.0a2"
current_version = "v24.04.0a3"
version_pattern = "v0Y.0M.PATCH[PYTAGNUM]"
commit_message = "Bump version {old_version} -> {new_version}"
commit = True
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
3 changes: 3 additions & 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 Expand Up @@ -198,6 +199,8 @@ def _toggle_install_widgets(self, change):
def _auto_select_code(self, change):
if change["new"] and not change["old"]:
for name, code_widget in self.codes.items():
if not DEFAULT_PARAMETERS["codes"].get(name):
continue
try:
code_widget.refresh()
code_widget.value = orm.load_code(
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
Loading

0 comments on commit f222658

Please sign in to comment.