Skip to content

Commit 46a8952

Browse files
[pre-commit.ci] pre-commit autoupdate (#613)
1 parent 81eb4b4 commit 46a8952

File tree

10 files changed

+10
-18
lines changed

10 files changed

+10
-18
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
# Python
2020
- repo: https://github.com/astral-sh/ruff-pre-commit
2121
# Ruff version.
22-
rev: v0.2.2
22+
rev: v0.3.2
2323
hooks:
2424
- id: ruff
2525
args: ["--fix"]

dpdata/amber/mask.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Amber mask."""
2+
23
try:
34
import parmed
45
except ImportError:

dpdata/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Command line interface for dpdata."""
2+
23
import argparse
34
from typing import Optional
45

dpdata/cp2k/output.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ def get_xyz_block_generator(self):
117117
lines.append(self.xyz_file_object.readline())
118118
if not lines[-1]:
119119
raise RuntimeError(
120-
"this xyz file may lack of lines, should be {};lines:{}".format(
121-
atom_num + 2, lines
122-
)
120+
f"this xyz file may lack of lines, should be {atom_num + 2};lines:{lines}"
123121
)
124122
yield lines
125123

dpdata/deepmd/hdf5.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utils for deepmd/hdf5 format."""
2+
23
from __future__ import annotations
34

45
import warnings

dpdata/driver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Driver plugin system."""
2+
23
from abc import ABC, abstractmethod
34
from typing import TYPE_CHECKING, Callable, List, Union
45

dpdata/format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Implement the format plugin system."""
2+
23
import os
34
from abc import ABC
45

dpdata/system.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,9 +1334,7 @@ def __repr__(self):
13341334
return self.__str__()
13351335

13361336
def __str__(self):
1337-
return "MultiSystems ({} systems containing {} frames)".format(
1338-
len(self.systems), self.get_nframes()
1339-
)
1337+
return f"MultiSystems ({len(self.systems)} systems containing {self.get_nframes()} frames)"
13401338

13411339
def __add__(self, others):
13421340
"""Magic method "+" operation."""

dpdata/vasp/xml.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,7 @@ def formulate_config(eles, types, posi, cell, ener, forc, strs_):
6868
ret += f"#Z {cell[2][0]:13.8f} {cell[2][1]:13.8f} {cell[2][2]:13.8f}\n"
6969
ret += "#W 1.0\n"
7070
ret += "#E %.10f\n" % (ener / natoms)
71-
ret += "#S {:.9e} {:.9e} {:.9e} {:.9e} {:.9e} {:.9e}\n".format(
72-
strs[0][0],
73-
strs[1][1],
74-
strs[2][2],
75-
strs[0][1],
76-
strs[1][2],
77-
strs[0][2],
78-
)
71+
ret += f"#S {strs[0][0]:.9e} {strs[1][1]:.9e} {strs[2][2]:.9e} {strs[0][1]:.9e} {strs[1][2]:.9e} {strs[0][2]:.9e}\n"
7972
ret += "#F\n"
8073
for ii in range(natoms):
8174
sp = np.matmul(cell.T, posi[ii])

dpdata/xyz/quip_gap_xyz.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def get_block_generator(self):
3636
lines.append(self.file_object.readline())
3737
if not lines[-1]:
3838
raise RuntimeError(
39-
"this xyz file may lack of lines, should be {};lines:{}".format(
40-
atom_num + 2, lines
41-
)
39+
f"this xyz file may lack of lines, should be {atom_num + 2};lines:{lines}"
4240
)
4341
yield lines
4442

0 commit comments

Comments
 (0)