diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a7f5340..99e1b2c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,3 +23,11 @@ repos: - id: ruff-format - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] + +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.11.0 + hooks: + - id: pretty-format-toml + args: [--autofix] + - id: pretty-format-yaml + args: [--autofix] diff --git a/aiida_wien2k/configs/codes/run123_lapw.yml b/aiida_wien2k/configs/codes/run123_lapw.yml index 3fadac2..b38dc79 100644 --- a/aiida_wien2k/configs/codes/run123_lapw.yml +++ b/aiida_wien2k/configs/codes/run123_lapw.yml @@ -1,16 +1,8 @@ ---- -label: "wien2k-run123_lapw" -description: "wien2k run123_lapw" -input_plugin: "wien2k-run123_lapw" +label: wien2k-run123_lapw +description: wien2k run123_lapw +input_plugin: wien2k-run123_lapw on_computer: true -remote_abs_path: "/area51/WIEN2k_21/run123_lapw" -computer: "localhost" -prepend_text: ' -export EDITOR="vim"; -[[ -z "${SLURM_JOB_NAME}" ]] && export WORKDIR="/${HOSTNAME}/scratch/aiida/scratch-${RANDOM}/case" || export WORKDIR="/${HOSTNAME}/scratch/aiida/scratch-${SLURM_JOB_NAME}/case"; -mkdir -p ${WORKDIR}; -cd case && cp -p * ${WORKDIR}; -AIIDADIR=${PWD}; -ln -s ${WORKDIR} case; -cd ${WORKDIR}' -append_text: " cp -p *.struct *.scf0 *.scf1 *.scf2 *.scfc *.scfm *.error* *.dayfile *.klist *3k.in0 ${AIIDADIR}" +remote_abs_path: /area51/WIEN2k_21/run123_lapw +computer: localhost +prepend_text: ' export EDITOR="vim"; [[ -z "${SLURM_JOB_NAME}" ]] && export WORKDIR="/${HOSTNAME}/scratch/aiida/scratch-${RANDOM}/case" || export WORKDIR="/${HOSTNAME}/scratch/aiida/scratch-${SLURM_JOB_NAME}/case"; mkdir -p ${WORKDIR}; cd case && cp -p * ${WORKDIR}; AIIDADIR=${PWD}; ln -s ${WORKDIR} case; cd ${WORKDIR}' +append_text: ' cp -p *.struct *.scf0 *.scf1 *.scf2 *.scfc *.scfm *.error* *.dayfile *.klist *3k.in0 ${AIIDADIR}' diff --git a/aiida_wien2k/configs/computers/localhost.yml b/aiida_wien2k/configs/computers/localhost.yml index 0df6803..8f7d2dd 100644 --- a/aiida_wien2k/configs/computers/localhost.yml +++ b/aiida_wien2k/configs/computers/localhost.yml @@ -1,12 +1,11 @@ ---- -label: "localhost" -hostname: "localhost" +label: localhost +hostname: localhost transport: local -scheduler: "slurm" -work_dir: "/eos/rubel/aiida_workdir" -shebang: "#!/bin/bash" -mpirun_command: "mpirun -np {tot_num_mpiprocs}" -mpiprocs_per_machine: "1" -prepend_text: " " -append_text: " " -description: "localhost" +scheduler: slurm +work_dir: /eos/rubel/aiida_workdir +shebang: '#!/bin/bash' +mpirun_command: mpirun -np {tot_num_mpiprocs} +mpiprocs_per_machine: '1' +prepend_text: ' ' +append_text: ' ' +description: localhost diff --git a/pyproject.toml b/pyproject.toml index b554ad2..1304fd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,37 +1,30 @@ [build-system] -requires = ['flit_core >=3.4,<4'] build-backend = 'flit_core.buildapi' +requires = ['flit_core >=3.4,<4'] [project] -name = 'aiida-wien2k' -dynamic = ['description', 'version'] authors = [{name = 'The AiiDA team', email = 'developers@aiida.net'}] -readme = 'README.md' -license = {file = 'LICENSE'} classifiers = [ - 'Development Status :: 5 - Production/Stable', - 'Framework :: AiiDA', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', + 'Development Status :: 5 - Production/Stable', + 'Framework :: AiiDA', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12' ] -keywords = ['aiida', 'workflows'] -requires-python = '>=3.8' dependencies = [ - 'aiida_core[atomic_tools]~=2.0', - 'fuzzywuzzy~=0.18.0', -] - -[project.optional-dependencies] -dev = [ - 'pgtest~=1.3', - 'pre-commit~=2.2', - 'pytest-regressions~=2.0', + 'aiida_core[atomic_tools]~=2.0', + 'fuzzywuzzy~=0.18.0' ] +dynamic = ['description', 'version'] +keywords = ['aiida', 'workflows'] +license = {file = 'LICENSE'} +name = 'aiida-wien2k' +readme = 'README.md' +requires-python = '>=3.8' [project.entry-points.'aiida.calculations'] 'wien2k-run123_lapw' = 'aiida_wien2k.calculations.run123_lapw:Wien2kRun123Lapw' @@ -42,32 +35,39 @@ dev = [ [project.entry-points.'aiida.workflows'] 'wien2k.scf123_wf' = 'aiida_wien2k.workflows.scf123_workchain:Wien2kScf123WorkChain' +[project.optional-dependencies] +dev = [ + 'pgtest~=1.3', + 'pre-commit~=2.2', + 'pytest-regressions~=2.0' +] + +[tool.pytest.ini_options] +filterwarnings = [ + 'ignore:Creating AiiDA configuration folder.*:UserWarning', + 'ignore:Object of type .* not in session, .* operation along .* will not proceed:sqlalchemy.exc.SAWarning' +] + [tool.ruff] ignore = [ 'PLR0911', # Too many return statements 'PLR0912', # Too many branches 'PLR0915', # Too many statements - 'PLR2004', # Magic value used in comparison + 'PLR2004' # Magic value used in comparison ] line-length = 120 select = [ - 'E', # pydocstyle - 'W', # pydocstyle - 'F', # pyflakes - 'I', # isort - 'N', # pep8-naming + 'E', # pydocstyle + 'W', # pydocstyle + 'F', # pyflakes + 'I', # isort + 'N', # pep8-naming 'PLC', # pylint-convention 'PLE', # pylint-error 'PLR', # pylint-refactor 'PLW', # pylint-warning - 'RUF' # ruff + 'RUF' # ruff ] [tool.ruff.format] quote-style = 'single' - -[tool.pytest.ini_options] -filterwarnings = [ - 'ignore:Creating AiiDA configuration folder.*:UserWarning', - 'ignore:Object of type .* not in session, .* operation along .* will not proceed:sqlalchemy.exc.SAWarning', -]