Skip to content

Commit

Permalink
Precommit: Add formatters for TOML and YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber committed Dec 22, 2023
1 parent 968d4cb commit 6b17722
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 64 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
22 changes: 7 additions & 15 deletions aiida_wien2k/configs/codes/run123_lapw.yml
Original file line number Diff line number Diff line change
@@ -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}'
21 changes: 10 additions & 11 deletions aiida_wien2k/configs/computers/localhost.yml
Original file line number Diff line number Diff line change
@@ -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
76 changes: 38 additions & 38 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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',
]

0 comments on commit 6b17722

Please sign in to comment.