Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 28, 2023
1 parent 87a62a6 commit d99b503
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 29 deletions.
1 change: 0 additions & 1 deletion aiidalab_sssp/inspect/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


def convergence(pseudos: dict, wf_name, measure_name, ylabel, threshold=None):

px = 1 / plt.rcParams["figure.dpi"]
fig, (ax1, ax2) = plt.subplots(
1, 2, gridspec_kw={"width_ratios": [2, 1]}, figsize=(960 * px, 360 * px)
Expand Down
2 changes: 0 additions & 2 deletions aiidalab_sssp/inspect/subwidgets/convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ def get_threshold(property_name) -> dict:


class ConvergenceWidget(ipw.VBox):

pseudos = traitlets.Dict(allow_none=True)

def __init__(self):

# using raido button widget so user only choose one proper to check
# at one time. It can be more, but pollute the UX and not useful.
self.property_select = ipw.RadioButtons(
Expand Down
11 changes: 0 additions & 11 deletions aiidalab_sssp/inspect/subwidgets/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class _PlotConvergenBaseWidget(ipw.VBox):

selected_pseudos = traitlets.Dict(allow_none=True)

_WF = "Not implement"
Expand All @@ -26,7 +25,6 @@ def __init__(self):

@traitlets.observe("selected_pseudos")
def _on_pseudos_change(self, change):

if change["new"]:
with self.output:
clear_output(wait=True)
Expand All @@ -42,71 +40,62 @@ def _on_pseudos_change(self, change):


class PlotCohesiveEnergyConvergeWidget(_PlotConvergenBaseWidget):

_WF = "convergence_cohesive_energy"
_MEASURE = "cohesive_energy_per_atom"
_YLABEL = "Cohesive Energy per atom (meV/atom)"
_THRESHOLD = None


class PlotCohesiveEnergyConvergeDiffWidget(_PlotConvergenBaseWidget):

_WF = "convergence_cohesive_energy"
_MEASURE = "absolute_diff"
_YLABEL = "Cohesive Energy per atom (absolute error, meV/atom)"
_THRESHOLD = 2.0


class PlotPhononFrequenciesConvergeAbsWidget(_PlotConvergenBaseWidget):

_WF = "convergence_phonon_frequencies"
_MEASURE = "absolute_diff"
_YLABEL = "Phonon frequencies ω (absolute error, cm-1)"
_THRESHOLD = None


class PlotPhononFrequenciesConvergeRelWidget(_PlotConvergenBaseWidget):

_WF = "convergence_phonon_frequencies"
_MEASURE = "relative_diff"
_YLABEL = "Phonon frequencies ω (relative error, %)"
_THRESHOLD = 2.0


class PlotPressureConvergeWidget(_PlotConvergenBaseWidget):

_WF = "convergence_pressure"
_MEASURE = "pressure"
_YLABEL = "Pressure (GPa)"
_THRESHOLD = None


class PlotPressureConvergeRelWidget(_PlotConvergenBaseWidget):

_WF = "convergence_pressure"
_MEASURE = "relative_diff"
_YLABEL = "Pressure (relative error, %)"
_THRESHOLD = 1.0


class PlotDeltaConvergeWidget(_PlotConvergenBaseWidget):

_WF = "convergence_delta"
_MEASURE = "delta"
_YLABEL = "Δ -factor (meV)"
_THRESHOLD = None


class PlotDeltaConvergeRelWidget(_PlotConvergenBaseWidget):

_WF = "convergence_delta"
_MEASURE = "relative_diff"
_YLABEL = "Delta (relative error, %)"
_THRESHOLD = 2.0


class PlotBandsConvergeWidget(_PlotConvergenBaseWidget):

_WF = "convergence_bands"
_MEASURE = "eta_c"
_YLABEL = "η up above fermi energe 5 eV (meV)"
Expand Down
1 change: 0 additions & 1 deletion aiidalab_sssp/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.Unicode(allow_none=True)

Expand Down
2 changes: 0 additions & 2 deletions aiidalab_sssp/setup_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def setup_codes():


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 Expand Up @@ -324,7 +323,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
7 changes: 0 additions & 7 deletions aiidalab_sssp/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def reset(self): # unconfirm


class WorkChainSettings(ipw.VBox):

calc_type_help = ipw.HTML(
"""<div style="line-height: 140%; padding-top: 6px; padding-bottom: 0px">
The acwf protocol is used to set the parameters used for pseudopotential
Expand All @@ -182,7 +181,6 @@ class WorkChainSettings(ipw.VBox):
properties_list = traitlets.List()

def __init__(self, **kwargs):

# Accuracy properties
self.delta_measure = ipw.Checkbox(
description="",
Expand Down Expand Up @@ -342,7 +340,6 @@ def _update_properties_list(self, _):


class ConfigureSsspWorkChainStep(ipw.VBox, WizardAppWidgetStep):

confirmed = traitlets.Bool()
previous_step_state = traitlets.UseEnum(WizardAppWidgetStep.State)
workchain_settings = traitlets.Instance(WorkChainSettings, allow_none=True)
Expand Down Expand Up @@ -849,7 +846,6 @@ def _update_resources(self, change):
self.set_resource_defaults(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 @@ -998,7 +994,6 @@ def _identify_submission_blockers(self):


class NodeViewWidget(ipw.VBox):

node = traitlets.Instance(Node, allow_none=True)

def __init__(self, **kwargs):
Expand All @@ -1015,7 +1010,6 @@ def _observe_node(self, change):


class ViewSsspAppWorkChainStatusAndResultsStep(ipw.VBox, WizardAppWidgetStep):

value = traitlets.Unicode(allow_none=True)

def __init__(self, **kwargs):
Expand Down Expand Up @@ -1093,7 +1087,6 @@ def parse_state_to_info(process_state, exit_status=None) -> str:


class ShowVerificationStatus(ipw.VBox):

value = traitlets.Unicode(allow_none=True)

def __init__(self, **kwargs):
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ url = https://github.com/aiidalab/aiidalab-sssp
author = Jusong Yu
author_email = jusong.yu@psi.ch
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers =
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
project_urls =
Logo = https://raw.githubusercontent.com/aiidalab/aiidalab-sssp/main/miscellaneous/logo-sssp.png
Bug Tracker = https://github.com/aiidalab/aiidalab-sssp/issues
Expand Down
2 changes: 1 addition & 1 deletion viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def viewer(obj, downloadable=True, **kwargs):
try:
_viewer = AIIDA_VIEWER_MAPPING[obj.node_type]
return _viewer(obj, downloadable=downloadable, **kwargs)
except (KeyError) as exc:
except KeyError as exc:
if obj.node_type in str(exc):
warnings.warn(
"Did not find an appropriate viewer for the {} object. Returning the object "
Expand Down

0 comments on commit d99b503

Please sign in to comment.