diff --git a/aiida_cp2k/calculations/__init__.py b/aiida_cp2k/calculations/__init__.py index 6dfa9c3..15120f0 100644 --- a/aiida_cp2k/calculations/__init__.py +++ b/aiida_cp2k/calculations/__init__.py @@ -23,9 +23,9 @@ write_pseudos, ) -BandsData = DataFactory("core.array.bands") # pylint: disable=invalid-name -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name -KpointsData = DataFactory("core.array.kpoints") # pylint: disable=invalid-name +BandsData = DataFactory("core.array.bands") +StructureData = DataFactory("core.structure") +KpointsData = DataFactory("core.array.kpoints") UpfData = DataFactory("pseudo.upf") @@ -224,8 +224,6 @@ def prepare_for_submission(self, folder): :return: `aiida.common.datastructures.CalcInfo` instance """ - # pylint: disable=too-many-statements,too-many-branches - # Create cp2k input file. inp = Cp2kInput(self.inputs.parameters.get_dict()) inp.add_keyword("GLOBAL/PROJECT", self._DEFAULT_PROJECT_NAME) diff --git a/aiida_cp2k/parsers/__init__.py b/aiida_cp2k/parsers/__init__.py index 476b358..26e133d 100644 --- a/aiida_cp2k/parsers/__init__.py +++ b/aiida_cp2k/parsers/__init__.py @@ -18,8 +18,8 @@ # - -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name -BandsData = DataFactory("core.array.bands") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") +BandsData = DataFactory("core.array.bands") class Cp2kBaseParser(Parser): @@ -71,9 +71,7 @@ def _parse_trajectory(self): from ase import Atoms - fname = ( - self.node.process_class._DEFAULT_RESTART_FILE_NAME - ) # pylint: disable=protected-access + fname = self.node.process_class._DEFAULT_RESTART_FILE_NAME # Check if the restart file is present. if fname not in self.retrieved.base.repository.list_object_names(): diff --git a/aiida_cp2k/utils/datatype_helpers.py b/aiida_cp2k/utils/datatype_helpers.py index b9d23bd..8c12e9e 100644 --- a/aiida_cp2k/utils/datatype_helpers.py +++ b/aiida_cp2k/utils/datatype_helpers.py @@ -136,7 +136,6 @@ def validate_basissets(inp, basissets, structure): listed in a KIND section, or none of them are, at which point they're verified against the symbols in the structure. """ - # pylint: disable=too-many-branches,too-many-statements # convert a structure # { @@ -294,8 +293,6 @@ def validate_pseudos_namespace(pseudos, _): def validate_pseudos(inp, pseudos, structure): """Verify that all referenced pseudos are present in the input""" - # pylint: disable=too-many-branches,too-many-statements - pseudos_specified = {pseudo for _, pseudo in _unpack(pseudos)} pseudos_used = set() explicit_kinds = [] # list of kinds with explicitly specified kind sections diff --git a/aiida_cp2k/utils/parser.py b/aiida_cp2k/utils/parser.py index 7dbc1b5..774f4f1 100644 --- a/aiida_cp2k/utils/parser.py +++ b/aiida_cp2k/utils/parser.py @@ -28,7 +28,7 @@ def parse_cp2k_output(fstring): def parse_cp2k_output_advanced( fstring, -): # pylint: disable=too-many-locals, too-many-statements, too-many-branches +): """Parse CP2K output into a dictionary (ADVANCED: more info parsed @ PRINT_LEVEL MEDIUM).""" lines = fstring.splitlines() @@ -380,8 +380,7 @@ def parse_cp2k_trajectory(content): import numpy as np - # pylint: disable=protected-access - # parse coordinate section + # Parse coordinate section match = re.search(r"\n\s*&COORD\n(.*?)\n\s*&END COORD\n", content, re.DOTALL) coord_lines = [line.strip().split() for line in match.group(1).splitlines()] diff --git a/aiida_cp2k/utils/workchains.py b/aiida_cp2k/utils/workchains.py index 74e89f4..095def8 100644 --- a/aiida_cp2k/utils/workchains.py +++ b/aiida_cp2k/utils/workchains.py @@ -10,7 +10,7 @@ from aiida.orm import Dict from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") HARTREE2EV = 27.211399 HARTREE2KJMOL = 2625.500 @@ -36,7 +36,7 @@ def merge_dict(dct, merge_dct): @calcfunction -def merge_Dict(d1, d2): # pylint: disable=invalid-name +def merge_Dict(d1, d2): """Make all the data in the second Dict overwrite the corrisponding data in the first Dict""" d1_dict = d1.get_dict() d2_dict = d2.get_dict() @@ -86,9 +86,7 @@ def ot_has_small_bandgap(cp2k_input, cp2k_output, bandgap_thr_ev): list_true = [True, "T", "t", ".TRUE.", "True", "true"] # add more? try: ot_settings = cp2k_input["FORCE_EVAL"]["DFT"]["SCF"]["OT"] - if ( - "_" not in ot_settings.keys() or ot_settings["_"] in list_true - ): # pylint: disable=simplifiable-if-statement + if "_" not in ot_settings.keys() or ot_settings["_"] in list_true: using_ot = True else: using_ot = False @@ -103,7 +101,7 @@ def ot_has_small_bandgap(cp2k_input, cp2k_output, bandgap_thr_ev): @calcfunction -def check_resize_unit_cell(struct, threshold): # pylint: disable=too-many-locals +def check_resize_unit_cell(struct, threshold): """Returns the multiplication factors for the cell vectors to respect, in every direction: min(perpendicular_width) > threshold. """ diff --git a/aiida_cp2k/workchains/base.py b/aiida_cp2k/workchains/base.py index 3040618..4a1412c 100644 --- a/aiida_cp2k/workchains/base.py +++ b/aiida_cp2k/workchains/base.py @@ -12,7 +12,7 @@ from ..utils import add_ext_restart_section, add_wfn_restart_section -Cp2kCalculation = CalculationFactory('cp2k') # pylint: disable=invalid-name +Cp2kCalculation = CalculationFactory('cp2k') class Cp2kBaseWorkChain(BaseRestartWorkChain): @@ -81,7 +81,7 @@ def restart_incomplete_calculation(self, calc): "Sending a signal to stop the Base work chain.") # Signaling to the base work chain that the problem could not be recovered. - return ProcessHandlerReport(True, self.exit_codes.NO_RESTART_DATA) # pylint: disable=no-member + return ProcessHandlerReport(True, self.exit_codes.NO_RESTART_DATA) self.ctx.inputs.parent_calc_folder = calc.outputs.remote_folder params = self.ctx.inputs.parameters diff --git a/conftest.py b/conftest.py index 18f3964..352b999 100644 --- a/conftest.py +++ b/conftest.py @@ -1,13 +1,11 @@ -""" -For pytest initialise a test database and profile -""" +"""For pytest initialise a test database and profile.""" import pytest -pytest_plugins = ["aiida.manage.tests.pytest_fixtures"] # pylint: disable=invalid-name +pytest_plugins = ["aiida.manage.tests.pytest_fixtures"] @pytest.fixture(scope="function") -def cp2k_code(aiida_local_code_factory): # pylint: disable=unused-argument +def cp2k_code(aiida_local_code_factory): return aiida_local_code_factory("cp2k", "cp2k") @@ -18,13 +16,13 @@ def clear_database(aiida_profile_clean): # from https://stackoverflow.com/a/25188424 # required for examples for optional features to show appropriate error messages -def pytest_configure(config): # pylint: disable=unused-argument +def pytest_configure(config): import sys - sys._called_from_test = True # pylint: disable=protected-access + sys._called_from_test = True -def pytest_unconfigure(config): # pylint: disable=unused-argument +def pytest_unconfigure(config): import sys - del sys._called_from_test # pylint: disable=protected-access + del sys._called_from_test diff --git a/docs/source/conf.py b/docs/source/conf.py index dca5cfa..4c169e5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,8 +10,6 @@ serve to show the default. """ -# pylint: disable=invalid-name,ungrouped-imports - import os import sys import time @@ -32,7 +30,7 @@ html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] -import aiida_cp2k # pylint: disable=wrong-import-position +import aiida_cp2k # -- General configuration ------------------------------------------------ @@ -80,7 +78,6 @@ if current_year == copyright_first_year else f"{copyright_first_year}-{current_year}" ) -# pylint: disable=redefined-builtin copyright = f"{copyright_year_string}, {copyright_owners}. All rights reserved." # The version info for the project you're documenting, acts as replacement for diff --git a/examples/gaussian_datatypes/example_automatic.py b/examples/gaussian_datatypes/example_automatic.py index 5eeb353..921b118 100644 --- a/examples/gaussian_datatypes/example_automatic.py +++ b/examples/gaussian_datatypes/example_automatic.py @@ -1,4 +1,3 @@ -# pylint: disable=import-outside-toplevel ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,7 +17,7 @@ from aiida.plugins import DataFactory from gdt_data import load_data -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_gdt(cp2k_code): @@ -95,4 +94,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/gaussian_datatypes/example_explicit.py b/examples/gaussian_datatypes/example_explicit.py index a0b9596..9d336b4 100644 --- a/examples/gaussian_datatypes/example_explicit.py +++ b/examples/gaussian_datatypes/example_explicit.py @@ -1,4 +1,3 @@ -# pylint: disable=import-outside-toplevel ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,7 +17,7 @@ from aiida.plugins import DataFactory from gdt_data import load_data -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_gdt(cp2k_code): @@ -113,4 +112,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/gaussian_datatypes/gdt_data.py b/examples/gaussian_datatypes/gdt_data.py index 3ae4619..9a2c268 100644 --- a/examples/gaussian_datatypes/gdt_data.py +++ b/examples/gaussian_datatypes/gdt_data.py @@ -1,4 +1,3 @@ -# pylint: disable=import-outside-toplevel ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -59,8 +58,8 @@ def load_data(prefix="MY-"): 0.25682890 0 """ - BasisSet = DataFactory("gaussian.basisset") # pylint: disable=invalid-name - Pseudo = DataFactory("gaussian.pseudo") # pylint: disable=invalid-name + BasisSet = DataFactory("gaussian.basisset") + Pseudo = DataFactory("gaussian.pseudo") fhandle_bset = StringIO(bset_input) fhandle_pseudo = StringIO(pseudo_input) diff --git a/examples/single_calculations/example_bands.py b/examples/single_calculations/example_bands.py index 361693a..fa2dbf2 100644 --- a/examples/single_calculations/example_bands.py +++ b/examples/single_calculations/example_bands.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,8 +17,8 @@ from aiida.plugins import DataFactory from ase.atoms import Atoms -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name -KpointsData = DataFactory("core.array.kpoints") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") +KpointsData = DataFactory("core.array.kpoints") def example_bands(cp2k_code): @@ -241,4 +240,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_dft.py b/examples/single_calculations/example_dft.py index 3eac49a..5cd0188 100644 --- a/examples/single_calculations/example_dft.py +++ b/examples/single_calculations/example_dft.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -17,7 +16,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_dft(cp2k_code): @@ -120,4 +119,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_dft_atomic_kinds.py b/examples/single_calculations/example_dft_atomic_kinds.py index f8b26d9..bd35375 100644 --- a/examples/single_calculations/example_dft_atomic_kinds.py +++ b/examples/single_calculations/example_dft_atomic_kinds.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -17,7 +16,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_dft_atomic_kinds(cp2k_code): @@ -141,4 +140,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_failure.py b/examples/single_calculations/example_failure.py index 92d2565..f09091d 100644 --- a/examples/single_calculations/example_failure.py +++ b/examples/single_calculations/example_failure.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -58,4 +57,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_geopt.py b/examples/single_calculations/example_geopt.py index 01909d5..8a43331 100644 --- a/examples/single_calculations/example_geopt.py +++ b/examples/single_calculations/example_geopt.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -17,7 +16,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_geopt(cp2k_code): @@ -147,4 +146,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_max_error.py b/examples/single_calculations/example_max_error.py index 0fed5a9..7f33f0d 100644 --- a/examples/single_calculations/example_max_error.py +++ b/examples/single_calculations/example_max_error.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -17,7 +16,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import CalculationFactory, DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") Cp2kCalculation = CalculationFactory("cp2k") @@ -134,4 +133,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_mm.py b/examples/single_calculations/example_mm.py index eeaeff2..fcf4547 100644 --- a/examples/single_calculations/example_mm.py +++ b/examples/single_calculations/example_mm.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -45,9 +44,7 @@ def example_mm(cp2k_code): END""" ) - water_pot = SinglefileData( - file=os.path.join("/tmp", "water.pot") - ) # pylint: disable=no-value-for-parameter + water_pot = SinglefileData(file=os.path.join("/tmp", "water.pot")) thisdir = os.path.dirname(os.path.realpath(__file__)) @@ -148,4 +145,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_multiple_force_eval.py b/examples/single_calculations/example_multiple_force_eval.py index 7f34eb1..9a047bc 100644 --- a/examples/single_calculations/example_multiple_force_eval.py +++ b/examples/single_calculations/example_multiple_force_eval.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -17,7 +16,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_multiple_force_eval(cp2k_code): @@ -226,4 +225,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_no_struct.py b/examples/single_calculations/example_no_struct.py index 18c3a3a..2913818 100644 --- a/examples/single_calculations/example_no_struct.py +++ b/examples/single_calculations/example_no_struct.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -125,4 +124,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_precision.py b/examples/single_calculations/example_precision.py index f2dedd4..0630595 100644 --- a/examples/single_calculations/example_precision.py +++ b/examples/single_calculations/example_precision.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,7 +17,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_precision(cp2k_code): @@ -144,4 +143,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_restart.py b/examples/single_calculations/example_restart.py index 30da880..2c0d049 100644 --- a/examples/single_calculations/example_restart.py +++ b/examples/single_calculations/example_restart.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -19,7 +18,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_restart(cp2k_code): @@ -178,4 +177,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/single_calculations/example_structure_through_file.py b/examples/single_calculations/example_structure_through_file.py index f61045d..595f725 100644 --- a/examples/single_calculations/example_structure_through_file.py +++ b/examples/single_calculations/example_structure_through_file.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -17,7 +16,7 @@ from aiida.orm import Dict, SinglefileData, load_code from aiida.plugins import DataFactory -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_structure_through_file(cp2k_code): @@ -131,4 +130,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/workchains/example_base_energy_restart.py b/examples/workchains/example_base_energy_restart.py index df4269a..9b09b62 100644 --- a/examples/workchains/example_base_energy_restart.py +++ b/examples/workchains/example_base_energy_restart.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,7 +17,7 @@ from aiida.plugins import DataFactory, WorkflowFactory Cp2kBaseWorkChain = WorkflowFactory("cp2k.base") -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_base(cp2k_code): @@ -141,4 +140,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/workchains/example_base_failed_restart.py b/examples/workchains/example_base_failed_restart.py index 11ec868..e08af2e 100644 --- a/examples/workchains/example_base_failed_restart.py +++ b/examples/workchains/example_base_failed_restart.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,7 +17,7 @@ from aiida.plugins import DataFactory, WorkflowFactory Cp2kBaseWorkChain = WorkflowFactory("cp2k.base") -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_base(cp2k_code): @@ -144,4 +143,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/examples/workchains/example_base_geoopt_restart.py b/examples/workchains/example_base_geoopt_restart.py index f0316d2..6c803f6 100644 --- a/examples/workchains/example_base_geoopt_restart.py +++ b/examples/workchains/example_base_geoopt_restart.py @@ -1,4 +1,3 @@ -# pylint: disable=invalid-name ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # @@ -18,7 +17,7 @@ from aiida.plugins import DataFactory, WorkflowFactory Cp2kBaseWorkChain = WorkflowFactory("cp2k.base") -StructureData = DataFactory("core.structure") # pylint: disable=invalid-name +StructureData = DataFactory("core.structure") def example_base(cp2k_code): @@ -141,4 +140,4 @@ def cli(codelabel): if __name__ == "__main__": - cli() # pylint: disable=no-value-for-parameter + cli() diff --git a/test/test_gaussian_datatypes.py b/test/test_gaussian_datatypes.py index cfb6956..d4cc9c7 100644 --- a/test/test_gaussian_datatypes.py +++ b/test/test_gaussian_datatypes.py @@ -19,7 +19,6 @@ # Note: the basissets and pseudos deliberately have a prefix to avoid matching # any CP2K provided entries which may creep in via the DATA_DIR -# pylint: disable=line-too-long, redefined-outer-name BSET_DATA = { "simple": """\ H MY-DZVP-MOLOPT-GTH MY-DZVP-MOLOPT-GTH-q1 @@ -104,7 +103,7 @@ def bsdataset(): def cp2k_basissets(bsdataset): """Returns basisset objects from the data above""" fhandle = StringIO(BSET_DATA[bsdataset]) - BasisSet = DataFactory("gaussian.basisset") # pylint: disable=invalid-name + BasisSet = DataFactory("gaussian.basisset") bsets = {} for bset in BasisSet.from_cp2k(fhandle): bset.store() # store because the validator accesses it when raising an error @@ -129,13 +128,11 @@ def pdataset(): def cp2k_pseudos(pdataset): """Returns pseudo objects from the data above""" fhandle = StringIO(PSEUDO_DATA[pdataset]) - Pseudo = DataFactory("gaussian.pseudo") # pylint: disable=invalid-name + Pseudo = DataFactory("gaussian.pseudo") return {p.element: p for p in Pseudo.from_cp2k(fhandle)} -def test_validation( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_validation(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Testing CP2K with the Basis Set stored in gaussian.basisset""" # structure @@ -194,9 +191,7 @@ def test_validation( assert calc_node.exit_status == 0 -def test_validation_fail( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_validation_fail(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Testing CP2K with the Basis Set stored in gaussian.basisset but missing one""" # structure @@ -261,9 +256,7 @@ def test_validation_fail( @pytest.mark.parametrize("bsdataset", ["multiple_o"]) -def test_validation_unused( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_validation_unused(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Pass more basissets than used in the input configuration""" # structure @@ -326,9 +319,7 @@ def test_validation_unused( assert "not referenced" in str(exc_info.value.__context__) -def test_validation_mfe_noauto( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_validation_mfe_noauto(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Test that multiple FORCE_EVAL without explicit assignment is rejected""" # structure @@ -501,9 +492,7 @@ def test_validation_mfe_noauto( ) -def test_validation_mfe( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_validation_mfe(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Test that multiple FORCE_EVAL with explicit assignment is accepted""" # structure @@ -679,9 +668,7 @@ def test_validation_mfe( assert calc_node.exit_status == 0 -def test_without_kinds( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_without_kinds(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Testing CP2K with the Basis Set stored in gaussian.basisset but without a KIND section""" # structure @@ -726,9 +713,7 @@ def test_without_kinds( assert calc_node.exit_status == 0 -def test_multiple_kinds( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_multiple_kinds(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Testing CP2K with multiple KIND sections for the same symbol""" # structure @@ -821,9 +806,7 @@ def test_multiple_kinds( ), "More than the expected 2 &KIND H sections found in generated input" -def test_multiple_kinds_auto( - cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database -): # pylint: disable=unused-argument +def test_multiple_kinds_auto(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database): """Testing CP2K with multiple KIND sections for the same symbol, auto-assigned""" # structure diff --git a/test/test_xyz.py b/test/test_xyz.py index 0f4faa5..048bb42 100644 --- a/test/test_xyz.py +++ b/test/test_xyz.py @@ -13,12 +13,11 @@ def test_atoms_to_xyz(): """Test that writing atoms to xyz format is handled correctly in the presence of tags""" h2o = Atoms("H2O") - # pylint: disable=assigning-non-slot h2o[0].charge = -1 h2o[0].tag = 1 h2o[1].tag = 2 - xyz = _atoms_to_xyz(h2o) # pylint: disable=protected-access + xyz = _atoms_to_xyz(h2o) assert "H1" in xyz, xyz assert "H2" in xyz, xyz