Skip to content

Commit

Permalink
Ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Jun 26, 2024
1 parent 3bc9e38 commit 94b91d5
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 24 deletions.
5 changes: 2 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
from glob import glob

import requests
from custodian import __version__ as CURRENT_VER
from invoke import task
from monty.os import cd

from custodian import __version__ as CURRENT_VER

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


@task
Expand Down
1 change: 0 additions & 1 deletion tests/ansible/test_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Any

import pytest

from custodian.ansible.actions import FileActions
from custodian.ansible.interpreter import Modder

Expand Down
6 changes: 3 additions & 3 deletions tests/cp2k/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import warnings
from glob import glob

from pymatgen.io.cp2k.inputs import Keyword, KeywordList
from pymatgen.io.cp2k.sets import StaticSet

from custodian.cp2k.handlers import (
AbortHandler,
FrozenJobErrorHandler,
Expand All @@ -20,6 +17,9 @@
get_conv,
)
from custodian.cp2k.interpreter import Cp2kModder
from pymatgen.io.cp2k.inputs import Keyword, KeywordList
from pymatgen.io.cp2k.sets import StaticSet

from tests.conftest import TEST_FILES

TEST_FILES_DIR = f"{TEST_FILES}/cp2k"
Expand Down
1 change: 1 addition & 0 deletions tests/cp2k/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from custodian import Custodian
from custodian.cp2k.jobs import Cp2kJob

from tests.conftest import TEST_FILES

MODULE_DIR = Path(__file__).resolve().parent
Expand Down
1 change: 1 addition & 0 deletions tests/feff/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from glob import glob

from custodian.feff.handlers import UnconvergedErrorHandler

from tests.conftest import TEST_FILES

__author__ = "Chen Zheng"
Expand Down
2 changes: 1 addition & 1 deletion tests/feff/test_jobs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

from custodian.feff.jobs import FeffJob
from monty.os import cd
from monty.tempfile import ScratchDir
from pymatgen.io.feff.inputs import Atoms, Tags

from custodian.feff.jobs import FeffJob
from tests.conftest import TEST_FILES

__author__ = "Chen Zheng"
Expand Down
1 change: 1 addition & 0 deletions tests/gaussian/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from unittest import TestCase

from custodian.gaussian.handlers import GaussianErrorHandler, WallTimeErrorHandler

from tests.conftest import TEST_FILES

__author__ = "Rasha Atwi"
Expand Down
1 change: 1 addition & 0 deletions tests/gaussian/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from unittest import TestCase

from custodian.gaussian.jobs import GaussianJob

from tests.conftest import TEST_FILES

__author__ = "Rasha Atwi"
Expand Down
1 change: 1 addition & 0 deletions tests/lobster/test_handlers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from custodian.lobster.handlers import ChargeSpillingValidator, EnoughBandsValidator, LobsterFilesValidator

from tests.conftest import TEST_FILES

test_files_lobster = f"{TEST_FILES}/lobster/lobsterouts"
Expand Down
2 changes: 1 addition & 1 deletion tests/lobster/test_jobs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import shutil

from custodian.lobster.jobs import LobsterJob
from monty.os import cd
from monty.tempfile import ScratchDir

from custodian.lobster.jobs import LobsterJob
from tests.conftest import TEST_FILES

test_files_lobster2 = f"{TEST_FILES}/lobster/lobsterins"
Expand Down
1 change: 1 addition & 0 deletions tests/nwchem/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from glob import glob

from custodian.nwchem.handlers import NwchemErrorHandler

from tests.conftest import TEST_FILES

__author__ = "shyuepingong"
Expand Down
2 changes: 1 addition & 1 deletion tests/qchem/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import unittest
from unittest import TestCase

from custodian.qchem.handlers import QChemErrorHandler
from pymatgen.io.qchem.inputs import QCInput

from custodian.qchem.handlers import QChemErrorHandler
from tests.conftest import TEST_FILES

try:
Expand Down
4 changes: 2 additions & 2 deletions tests/qchem/test_job_handler_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import unittest
from unittest import TestCase

from pymatgen.io.qchem.inputs import QCInput

from custodian.qchem.handlers import QChemErrorHandler
from custodian.qchem.jobs import QCJob
from pymatgen.io.qchem.inputs import QCInput

from tests.conftest import TEST_FILES

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/qchem/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from unittest.mock import patch

import pytest
from custodian.qchem.jobs import QCJob
from pymatgen.io.qchem.inputs import QCInput

from custodian.qchem.jobs import QCJob
from tests.conftest import TEST_FILES

try:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_custodian.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from glob import glob

import pytest
from ruamel.yaml import YAML

from custodian.custodian import (
Custodian,
ErrorHandler,
Expand All @@ -19,6 +17,7 @@
ValidationError,
Validator,
)
from ruamel.yaml import YAML


class ExitCodeJob(Job):
Expand Down
8 changes: 4 additions & 4 deletions tests/vasp/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
from glob import glob

import pytest
from monty.os.path import zpath
from pymatgen.io.vasp.inputs import Incar, Kpoints, Structure, VaspInput
from pymatgen.util.testing import PymatgenTest

from custodian.utils import tracked_lru_cache
from custodian.vasp.handlers import (
AliasingErrorHandler,
Expand All @@ -29,6 +25,10 @@
VaspErrorHandler,
WalltimeHandler,
)
from monty.os.path import zpath
from pymatgen.io.vasp.inputs import Incar, Kpoints, Structure, VaspInput
from pymatgen.util.testing import PymatgenTest

from tests.conftest import TEST_FILES

__author__ = "Shyue Ping Ong, Stephen Dacek, Janosh Riebesell"
Expand Down
4 changes: 2 additions & 2 deletions tests/vasp/test_io.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest
from monty.os.path import zpath

from custodian.utils import tracked_lru_cache
from custodian.vasp.io import load_outcar, load_vasprun
from monty.os.path import zpath

from tests.conftest import TEST_FILES


Expand Down
2 changes: 1 addition & 1 deletion tests/vasp/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import pymatgen
import pytest
from custodian.vasp.jobs import GenerateVaspInputJob, VaspJob, VaspNEBJob
from monty.os import cd
from monty.tempfile import ScratchDir
from pymatgen.io.vasp import Incar, Kpoints, Poscar

from custodian.vasp.jobs import GenerateVaspInputJob, VaspJob, VaspNEBJob
from tests.conftest import TEST_FILES

pymatgen.core.SETTINGS["PMG_VASP_PSP_DIR"] = TEST_FILES
Expand Down
2 changes: 1 addition & 1 deletion tests/vasp/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import numpy as np
import pytest
from custodian.vasp.utils import _estimate_num_k_points_from_kspacing, increase_k_point_density
from monty.os.path import zpath
from pymatgen.core import Lattice, Structure
from pymatgen.io.vasp import Kpoints
from pymatgen.util.testing import PymatgenTest

from custodian.vasp.utils import _estimate_num_k_points_from_kspacing, increase_k_point_density
from tests.conftest import TEST_FILES


Expand Down
2 changes: 1 addition & 1 deletion tests/vasp/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import shutil

import pytest

from custodian.vasp.validators import VaspAECCARValidator, VaspFilesValidator, VaspNpTMDValidator, VasprunXMLValidator

from tests.conftest import TEST_FILES


Expand Down

0 comments on commit 94b91d5

Please sign in to comment.