Skip to content

Commit

Permalink
fix all ruff FBT003 boolean positional value in function call
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Oct 19, 2023
1 parent 419e82e commit 3a12d53
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/atomate2/forcefields/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def make(self, structure: Structure) -> ForceFieldTaskDocument:
return ForceFieldTaskDocument.from_ase_compatible_result(
self.force_field_name,
result,
False,
1,
None,
None,
relax_cell=False,
steps=1,
relax_kwargs=None,
optimizer_kwargs=None,
**self.task_document_kwargs,
)

Expand Down
12 changes: 6 additions & 6 deletions src/atomate2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class Atomate2Settings(BaseSettings):
None, description="Store data from these files in database if present"
)
VASP_STORE_ADDITIONAL_JSON: bool = Field(
True,
default=True,
description="Ingest any additional JSON data present into database when "
"parsing VASP directories useful for storing duplicate of FW.json",
)
VASP_RUN_BADER: bool = Field(
False,
default=False,
description="Whether to run the Bader program when parsing VASP calculations."
"Requires the bader executable to be on the path.",
)
Expand All @@ -92,7 +92,7 @@ class Atomate2Settings(BaseSettings):
"to the simulation will be compressed. If False no file is compressed.",
)
VASP_INHERIT_INCAR: bool = Field(
True,
default=True,
description="Whether to inherit INCAR settings from previous calculation. "
"This might be useful to port Custodian fixes to child jobs but can also be "
"dangerous e.g. when switching from GGA to meta-GGA or relax to static jobs."
Expand All @@ -119,7 +119,7 @@ class Atomate2Settings(BaseSettings):
"cp2k.psmp", description="Command to run the MPI version of cp2k"
)
CP2K_RUN_BADER: bool = Field(
False,
default=False,
description="Whether to run the Bader program when parsing CP2K calculations."
"Requires the bader executable to be on the path.",
)
Expand Down Expand Up @@ -150,13 +150,13 @@ class Atomate2Settings(BaseSettings):
None, description="Store data from these files in database if present"
)
CP2K_STORE_ADDITIONAL_JSON: bool = Field(
True,
default=True,
description="Ingest any additional JSON data present into database when "
"parsing CP2K directories useful for storing duplicate of FW.json",
)

CP2K_ZIP_FILES: bool | Literal["atomate"] = Field(
True,
default=True,
description="Determine if the files in folder are being compressed. If True "
"all the files are compressed. If 'atomate' only a selection of files related "
"to the simulation will be compressed. If False no file is compressed.",
Expand Down
4 changes: 2 additions & 2 deletions tests/cp2k/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ def _check_input(ref_path, user_input):
from pymatgen.io.cp2k.inputs import Cp2kInput

ref = Cp2kInput.from_file(ref_path / "inputs" / "cp2k.inp")
user_input.verbosity(False)
ref.verbosity(False)
user_input.verbosity(verbosity=False)
ref.verbosity(verbosity=False)
user_string = " ".join(user_input.get_string().lower().split())
user_hash = md5(user_string.encode("utf-8")).hexdigest()

Expand Down
24 changes: 6 additions & 18 deletions tests/vasp/flows/test_phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ def test_phonon_wf_only_displacements3(mock_vasp, clean_dir):
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.temperatures, [0, 100, 200, 300, 400]
)
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.has_imaginary_modes, False
)
assert np.allclose(responses[job.jobs[-1].uuid][1].output.has_imaginary_modes)
assert responses[job.jobs[-1].uuid][1].output.force_constants is None
assert isinstance(responses[job.jobs[-1].uuid][1].output.jobdirs, PhononJobDirs)
assert isinstance(responses[job.jobs[-1].uuid][1].output.uuids, PhononUUIDs)
Expand Down Expand Up @@ -247,9 +245,7 @@ def test_phonon_wf_only_displacements_no_structural_transformation(
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.temperatures, [0, 100, 200, 300, 400]
)
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.has_imaginary_modes, False
)
assert np.allclose(responses[job.jobs[-1].uuid][1].output.has_imaginary_modes)
assert responses[job.jobs[-1].uuid][1].output.force_constants is None
assert isinstance(responses[job.jobs[-1].uuid][1].output.jobdirs, PhononJobDirs)
assert isinstance(responses[job.jobs[-1].uuid][1].output.uuids, PhononUUIDs)
Expand Down Expand Up @@ -381,9 +377,7 @@ def test_phonon_wf_only_displacements_kpath(mock_vasp, clean_dir, kpathscheme):
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.temperatures, [0, 100, 200, 300, 400]
)
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.has_imaginary_modes, False
)
assert np.allclose(responses[job.jobs[-1].uuid][1].output.has_imaginary_modes)
assert np.isclose(
responses[job.jobs[-1].uuid][1].output.force_constants.force_constants[0][0][0][
0
Expand Down Expand Up @@ -541,9 +535,7 @@ def test_phonon_wf_only_displacements_add_inputs(mock_vasp, clean_dir):
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.temperatures, [0, 100, 200, 300, 400]
)
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.has_imaginary_modes, False
)
assert np.allclose(responses[job.jobs[-1].uuid][1].output.has_imaginary_modes)
assert np.isclose(
responses[job.jobs[-1].uuid][1].output.force_constants.force_constants[0][0][0][
0
Expand Down Expand Up @@ -674,9 +666,7 @@ def test_phonon_wf_only_displacements_optional_settings(mock_vasp, clean_dir):
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.temperatures, [0, 100, 200, 300, 400]
)
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.has_imaginary_modes, False
)
assert np.allclose(responses[job.jobs[-1].uuid][1].output.has_imaginary_modes)
assert responses[job.jobs[-1].uuid][1].output.force_constants is None
assert isinstance(responses[job.jobs[-1].uuid][1].output.jobdirs, PhononJobDirs)
assert isinstance(responses[job.jobs[-1].uuid][1].output.uuids, PhononUUIDs)
Expand Down Expand Up @@ -774,9 +764,7 @@ def test_phonon_wf_all_steps(mock_vasp, clean_dir):
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.temperatures, [0, 100, 200, 300, 400]
)
assert np.allclose(
responses[job.jobs[-1].uuid][1].output.has_imaginary_modes, False
)
assert np.allclose(responses[job.jobs[-1].uuid][1].output.has_imaginary_modes)
assert np.isclose(
responses[job.jobs[-1].uuid][1].output.force_constants.force_constants[0][0][0][
0
Expand Down

0 comments on commit 3a12d53

Please sign in to comment.