Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1651

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
name: ruff lint
Expand Down
24 changes: 12 additions & 12 deletions notebooks/integration/InteractiveOutputTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@
],
"source": [
"for i in range(10):\n",
" assert (\n",
" j.output.forces.shape[0] == i + 1\n",
" ), \"Forces shape does not match number of taken steps\"\n",
" assert (\n",
" j.output.cells.shape[0] == i + 1\n",
" ), \"Cells shape does not match number of taken steps\"\n",
" assert j.output.forces.shape[0] == i + 1, (\n",
" \"Forces shape does not match number of taken steps\"\n",
" )\n",
" assert j.output.cells.shape[0] == i + 1, (\n",
" \"Cells shape does not match number of taken steps\"\n",
" )\n",
" j.structure.positions[0, :] += [0.1, 0.1, 0.1]\n",
" j.run()"
]
Expand Down Expand Up @@ -213,12 +213,12 @@
"metadata": {},
"outputs": [],
"source": [
"assert (\n",
" j.output.forces.shape == jl.output.forces.shape\n",
"), \"Forces shape not identical after re-loading the job\"\n",
"assert (\n",
" j.output.cells.shape == jl.output.cells.shape\n",
"), \"Cells shape not identical after re-loading the job\""
"assert j.output.forces.shape == jl.output.forces.shape, (\n",
" \"Forces shape not identical after re-loading the job\"\n",
")\n",
"assert j.output.cells.shape == jl.output.cells.shape, (\n",
" \"Cells shape not identical after re-loading the job\"\n",
")"
]
}
],
Expand Down
20 changes: 8 additions & 12 deletions pyiron_atomistics/sphinx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,15 +1032,12 @@ def set_convergence_precision(
ionic_force_tolerance = ionic_forces
if ionic_energy is not None:
ionic_energy_tolerance = ionic_energy
assert (
ionic_energy_tolerance is None or ionic_energy_tolerance > 0
), "ionic_energy_tolerance must be a positive float"
assert (
ionic_force_tolerance is None or ionic_force_tolerance > 0
), "ionic_force_tolerance must be a positive float"
assert (
electronic_energy is None or electronic_energy > 0
), "electronic_energy must be a positive float"
cond = ionic_energy_tolerance is None or ionic_energy_tolerance > 0
assert cond, "ionic_energy_tolerance must be a positive float"
cond = ionic_force_tolerance is None or ionic_force_tolerance > 0
assert cond, "ionic_force_tolerance must be a positive float"
cond = electronic_energy is None or electronic_energy > 0
assert cond, "electronic_energy must be a positive float"
if ionic_energy_tolerance is not None or ionic_force_tolerance is not None:
# self.input["dE"] = ionic_energy_tolerance
# self.input["dF"] = ionic_force_tolerance
Expand Down Expand Up @@ -1312,9 +1309,8 @@ def _get_potential_path(
potential_path = potentials.find_potential_file(
path=potentials.find_default(new_element)["Filename"].values[0][0]
)
assert os.path.isfile(
potential_path
), "such a file does not exist in the pp directory"
cond = os.path.isfile(potential_path)
assert cond, "such a file does not exist in the pp directory"
elif elem in modified_elements.keys():
new_element = modified_elements[elem]
if os.path.isabs(new_element):
Expand Down
4 changes: 2 additions & 2 deletions pyiron_atomistics/sphinx/output_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ def get_psi_rec(self, i, ispin, ik, compact=False):
ispin = np.arange(self.n_spin)[ispin]

off = self._n_gk[ik] * (i + ispin * self.n_states)
psire = self.wfile[f"psi-{ik+1}.re"][off : off + self._n_gk[ik]]
psiim = self.wfile[f"psi-{ik+1}.im"][off : off + self._n_gk[ik]]
psire = self.wfile[f"psi-{ik + 1}.re"][off : off + self._n_gk[ik]]
psiim = self.wfile[f"psi-{ik + 1}.im"][off : off + self._n_gk[ik]]
compact_wave = psire + 1j * psiim
if compact:
return compact_wave
Expand Down
2 changes: 1 addition & 1 deletion tests/atomic/master/test_murnaghan.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_fitting_routines(self):
ax=ax,
plot_kwargs={"color": "black", "label": f"plot{i}", "marker": "x"},
)
ax.set_title(f"Axis {i+1}")
ax.set_title(f"Axis {i + 1}")
self.assertEqual(len(ax.lines), 2)
with self.subTest(msg="standard polynomial fit"):
self.assertAlmostEqual(-90.71969974284912, murn.equilibrium_energy)
Expand Down
2 changes: 1 addition & 1 deletion tests/vasp/test_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def test_kspacing(self):
self.assertNotIn(
"KPOINTS",
job_kspace.files.list(),
"'KPOINTS' file written even when " "KPACING tag is present in INCAR",
"'KPOINTS' file written even when KPACING tag is present in INCAR",
)

self.assertTrue(len(w) <= 2)
Expand Down
Loading