From 8ff311798256b883157272245f35a52c5d839505 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:49:03 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- aiidalab_sssp/inspect/plot_utils.py | 1 - aiidalab_sssp/inspect/subwidgets/convergence.py | 2 -- aiidalab_sssp/inspect/subwidgets/plot.py | 11 ----------- aiidalab_sssp/process.py | 1 - aiidalab_sssp/setup_codes.py | 2 -- aiidalab_sssp/steps.py | 7 ------- setup.cfg | 5 +---- viewers.py | 2 +- 8 files changed, 2 insertions(+), 29 deletions(-) diff --git a/aiidalab_sssp/inspect/plot_utils.py b/aiidalab_sssp/inspect/plot_utils.py index ca1c4bd..5228c92 100644 --- a/aiidalab_sssp/inspect/plot_utils.py +++ b/aiidalab_sssp/inspect/plot_utils.py @@ -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) diff --git a/aiidalab_sssp/inspect/subwidgets/convergence.py b/aiidalab_sssp/inspect/subwidgets/convergence.py index 27ebeda..0273d28 100644 --- a/aiidalab_sssp/inspect/subwidgets/convergence.py +++ b/aiidalab_sssp/inspect/subwidgets/convergence.py @@ -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( diff --git a/aiidalab_sssp/inspect/subwidgets/plot.py b/aiidalab_sssp/inspect/subwidgets/plot.py index 429d598..b4df694 100644 --- a/aiidalab_sssp/inspect/subwidgets/plot.py +++ b/aiidalab_sssp/inspect/subwidgets/plot.py @@ -6,7 +6,6 @@ class _PlotConvergenBaseWidget(ipw.VBox): - selected_pseudos = traitlets.Dict(allow_none=True) _WF = "Not implement" @@ -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) @@ -42,7 +40,6 @@ 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)" @@ -50,7 +47,6 @@ class PlotCohesiveEnergyConvergeWidget(_PlotConvergenBaseWidget): class PlotCohesiveEnergyConvergeDiffWidget(_PlotConvergenBaseWidget): - _WF = "convergence_cohesive_energy" _MEASURE = "absolute_diff" _YLABEL = "Cohesive Energy per atom (absolute error, meV/atom)" @@ -58,7 +54,6 @@ class PlotCohesiveEnergyConvergeDiffWidget(_PlotConvergenBaseWidget): class PlotPhononFrequenciesConvergeAbsWidget(_PlotConvergenBaseWidget): - _WF = "convergence_phonon_frequencies" _MEASURE = "absolute_diff" _YLABEL = "Phonon frequencies ω (absolute error, cm-1)" @@ -66,7 +61,6 @@ class PlotPhononFrequenciesConvergeAbsWidget(_PlotConvergenBaseWidget): class PlotPhononFrequenciesConvergeRelWidget(_PlotConvergenBaseWidget): - _WF = "convergence_phonon_frequencies" _MEASURE = "relative_diff" _YLABEL = "Phonon frequencies ω (relative error, %)" @@ -74,7 +68,6 @@ class PlotPhononFrequenciesConvergeRelWidget(_PlotConvergenBaseWidget): class PlotPressureConvergeWidget(_PlotConvergenBaseWidget): - _WF = "convergence_pressure" _MEASURE = "pressure" _YLABEL = "Pressure (GPa)" @@ -82,7 +75,6 @@ class PlotPressureConvergeWidget(_PlotConvergenBaseWidget): class PlotPressureConvergeRelWidget(_PlotConvergenBaseWidget): - _WF = "convergence_pressure" _MEASURE = "relative_diff" _YLABEL = "Pressure (relative error, %)" @@ -90,7 +82,6 @@ class PlotPressureConvergeRelWidget(_PlotConvergenBaseWidget): class PlotDeltaConvergeWidget(_PlotConvergenBaseWidget): - _WF = "convergence_delta" _MEASURE = "delta" _YLABEL = "Δ -factor (meV)" @@ -98,7 +89,6 @@ class PlotDeltaConvergeWidget(_PlotConvergenBaseWidget): class PlotDeltaConvergeRelWidget(_PlotConvergenBaseWidget): - _WF = "convergence_delta" _MEASURE = "relative_diff" _YLABEL = "Delta (relative error, %)" @@ -106,7 +96,6 @@ class PlotDeltaConvergeRelWidget(_PlotConvergenBaseWidget): class PlotBandsConvergeWidget(_PlotConvergenBaseWidget): - _WF = "convergence_bands" _MEASURE = "eta_c" _YLABEL = "η up above fermi energe 5 eV (meV)" diff --git a/aiidalab_sssp/process.py b/aiidalab_sssp/process.py index 0d1b7b8..2959144 100644 --- a/aiidalab_sssp/process.py +++ b/aiidalab_sssp/process.py @@ -9,7 +9,6 @@ class WorkChainSelector(ipw.HBox): - # The PK of a 'aiida.workflows:quantumespresso.pw.bands' WorkChainNode. value = traitlets.Unicode(allow_none=True) diff --git a/aiidalab_sssp/setup_codes.py b/aiidalab_sssp/setup_codes.py index bcc54bf..0541af4 100644 --- a/aiidalab_sssp/setup_codes.py +++ b/aiidalab_sssp/setup_codes.py @@ -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) @@ -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() diff --git a/aiidalab_sssp/steps.py b/aiidalab_sssp/steps.py index 7fb60a3..b67d66a 100644 --- a/aiidalab_sssp/steps.py +++ b/aiidalab_sssp/steps.py @@ -159,7 +159,6 @@ def reset(self): # unconfirm class WorkChainSettings(ipw.VBox): - calc_type_help = ipw.HTML( """
The acwf protocol is used to set the parameters used for pseudopotential @@ -182,7 +181,6 @@ class WorkChainSettings(ipw.VBox): properties_list = traitlets.List() def __init__(self, **kwargs): - # Accuracy properties self.delta_measure = ipw.Checkbox( description="", @@ -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) @@ -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 @@ -998,7 +994,6 @@ def _identify_submission_blockers(self): class NodeViewWidget(ipw.VBox): - node = traitlets.Instance(Node, allow_none=True) def __init__(self, **kwargs): @@ -1015,7 +1010,6 @@ def _observe_node(self, change): class ViewSsspAppWorkChainStatusAndResultsStep(ipw.VBox, WizardAppWidgetStep): - value = traitlets.Unicode(allow_none=True) def __init__(self, **kwargs): @@ -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): diff --git a/setup.cfg b/setup.cfg index 1dd7a39..9cd76ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/viewers.py b/viewers.py index f4aaefd..667fbc8 100644 --- a/viewers.py +++ b/viewers.py @@ -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 "