From 8553de0944da5450bf45998db50f9f204143792f Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Thu, 12 Dec 2024 13:33:35 -0500 Subject: [PATCH 1/3] NonConvergingErrorHandler add doc string comment suggesting setting AMIX/BMIX doesn't seem to help much --- src/custodian/vasp/handlers.py | 3 +++ src/custodian/vasp/utils.py | 1 + 2 files changed, 4 insertions(+) diff --git a/src/custodian/vasp/handlers.py b/src/custodian/vasp/handlers.py index 2b152176..7ebfa857 100644 --- a/src/custodian/vasp/handlers.py +++ b/src/custodian/vasp/handlers.py @@ -1560,6 +1560,9 @@ class NonConvergingErrorHandler(ErrorHandler): Check if a run is hitting the maximum number of electronic steps at the last nionic_steps ionic steps (default=10). If so, change ALGO using a multi-step ladder scheme or kill the job. + + In some cases (ALGO=All or ALGO=Normal and ISMEAR < 0), this handler also changes AMIX + and BMIX but unsure if this helps much. Some anecdotal evidence suggests it doesn't. """ is_monitor = True diff --git a/src/custodian/vasp/utils.py b/src/custodian/vasp/utils.py index 5f937496..1dfe3de5 100644 --- a/src/custodian/vasp/utils.py +++ b/src/custodian/vasp/utils.py @@ -18,6 +18,7 @@ def _estimate_num_k_points_from_kspacing(structure: Structure, kspacing: float) Inputs: structure (Structure): structure used in the calculation kspacing (float): KSPACING used in the calculation + Returns: tuple[int,int,int] : the number of estimated k-points on each axis. From c12d389344f863cdf83c6d123e6676f714a7c057 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Thu, 12 Dec 2024 13:33:45 -0500 Subject: [PATCH 2/3] remove unused commit hooks --- .pre-commit-config.yaml | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18b046c8..1a80a172 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,16 +2,16 @@ exclude: ^(docs|tests/files|tasks.py) ci: autoupdate_schedule: monthly - skip: [ mypy, pyright ] + skip: [mypy, pyright] autofix_commit_msg: pre-commit auto-fixes autoupdate_commit_msg: pre-commit autoupdate repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.2 + rev: v0.8.3 hooks: - id: ruff - args: [ --fix, --unsafe-fixes ] + args: [--fix, --unsafe-fixes] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks @@ -30,16 +30,9 @@ repos: rev: v2.3.0 hooks: - id: codespell - stages: [ commit-msg ] - exclude_types: [ html ] - additional_dependencies: [ tomli ] # needed to read pyproject.toml below py3.11 - - - repo: https://github.com/MarcoGorelli/cython-lint - rev: v0.16.2 - hooks: - - id: cython-lint - args: [ --no-pycodestyle ] - - id: double-quote-cython-strings + stages: [commit-msg] + exclude_types: [html] + additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11 - repo: https://github.com/adamchainz/blacken-docs rev: 1.19.1 @@ -47,7 +40,7 @@ repos: - id: blacken-docs - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.42.0 + rev: v0.43.0 hooks: - id: markdownlint # MD013: line too long @@ -55,15 +48,9 @@ repos: # MD033: no inline HTML # MD041: first line in a file should be a top-level heading # MD025: single title - args: [ --disable, MD013, MD024, MD025, MD033, MD041, "--" ] - - - repo: https://github.com/kynan/nbstripout - rev: 0.8.0 - hooks: - - id: nbstripout - args: [ --drop-empty-cells, --keep-output ] + args: [--disable, MD013, MD024, MD025, MD033, MD041, "--"] - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.387 + rev: v1.1.390 hooks: - id: pyright From 2b6de367c50a2695c6d80906f67110b743086579 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Thu, 12 Dec 2024 13:34:29 -0500 Subject: [PATCH 3/3] use logger.exception over logger.warning in VaspJob.terminate to get whole stacktrace helps a lot with debugging --- src/custodian/vasp/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/custodian/vasp/jobs.py b/src/custodian/vasp/jobs.py index a94957c2..5485f8a4 100644 --- a/src/custodian/vasp/jobs.py +++ b/src/custodian/vasp/jobs.py @@ -725,7 +725,7 @@ def terminate(self, directory="./") -> None: proc.kill() return except (psutil.NoSuchProcess, psutil.AccessDenied) as exc: - logger.warning(f"Exception {exc} encountered while killing VASP.") + logger.exception(f"Exception {exc} encountered while killing VASP.") continue logger.warning(