Skip to content

Commit

Permalink
manual ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed May 6, 2024
1 parent cc2e704 commit 477618d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import warnings
from collections import Counter
from math import prod
from typing import ClassVar

import numpy as np
from monty.dev import deprecated
Expand Down Expand Up @@ -804,7 +805,7 @@ class AliasingErrorHandler(ErrorHandler):

is_monitor = True

error_msgs = {
error_msgs: ClassVar = {
"aliasing": ["WARNING: small aliasing (wrap around) errors must be expected"],
"aliasing_incar": ["Your FFT grids (NGX,NGY,NGZ) are not sufficient for an accurate"],
}
Expand Down
11 changes: 5 additions & 6 deletions custodian/vasp/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def double_relaxation_run(
wall-time handler which will write a read-only STOPCAR to
prevent VASP from deleting it once it finishes. Defaults to
False.
directory (str): Directory where the job was run. Defaults to './'.
Returns:
List of two jobs corresponding to an AFLOW style run.
Expand Down Expand Up @@ -382,12 +383,8 @@ def metagga_opt_run(
metaGGA = incar.get("METAGGA", "SCAN")

# Pre optimize WAVECAR and structure using regular GGA
pre_opt_settings = [
{
"dict": "INCAR",
"action": {"_set": {"METAGGA": None, "LWAVE": True, "NSW": 0}},
}
]
new_settings = {"METAGGA": None, "LWAVE": True, "NSW": 0}
pre_opt_settings = [{"dict": "INCAR", "action": {"_set": new_settings}}]
jobs = [
VaspJob(
vasp_cmd,
Expand Down Expand Up @@ -460,6 +457,7 @@ def full_opt_run(
half_kpts_first_relax (bool): Whether to halve the kpoint grid
for the first relaxation. Speeds up difficult convergence
considerably. Defaults to False.
directory (str): Directory where the job was run. Defaults to './'.
**vasp_job_kwargs: Passthrough kwargs to VaspJob. See
:class:`custodian.vasp.jobs.VaspJob`.
Expand Down Expand Up @@ -558,6 +556,7 @@ def constrained_opt_run(
which is more robust but can be a bit slow. The code does fall
back on the bisection when bfgs gives a nonsensical result,
e.g., negative lattice params.
directory (str): Directory where the job was run. Defaults to './'.
**vasp_job_kwargs: Passthrough kwargs to VaspJob. See
:class:`custodian.vasp.jobs.VaspJob`.
Expand Down
4 changes: 3 additions & 1 deletion docs/_themes/flask_theme_support.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""flasky extensions. flasky pygments style based on tango style."""

from typing import ClassVar

from pygments.style import Style
from pygments.token import (
Comment,
Expand All @@ -23,7 +25,7 @@ class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = ""

styles = {
styles: ClassVar = {
# No corresponding class for the following:
# Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Expand Down
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from custodian import __version__ as CURRENT_VER

NEW_VER = datetime.datetime.today().strftime("%Y.%-m.%-d")
NEW_VER = datetime.datetime.now(tz=datetime.timezone.utc).strftime("%Y.%-m.%-d")


@task
Expand Down
4 changes: 2 additions & 2 deletions tests/gaussian/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def test_better_guess(self):
self.output_file,
self.stderr_file,
self.backup,
True,
self.directory,
cart_coords=True,
directory=self.directory,
)
jobs = list(job_gen)
assert len(jobs) == 1, "One job should be generated under normal conditions."
Expand Down

0 comments on commit 477618d

Please sign in to comment.