Skip to content

Commit 5be2601

Browse files
committed
Update pre-commit hooks
1 parent 2a4de4d commit 5be2601

File tree

8 files changed

+142
-29
lines changed

8 files changed

+142
-29
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-ast
@@ -25,12 +25,12 @@ repos:
2525
hooks:
2626
- id: remove-crlf
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.7.1
28+
rev: v0.12.9
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff
3232
args: ["--fix", "--show-fixes"]
3333
- repo: https://github.com/python-jsonschema/check-jsonschema
34-
rev: 0.29.4
34+
rev: 0.33.3
3535
hooks:
3636
- id: check-github-workflows

src/tinyff/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@
2626
from .trajectory import NPYWriter, PDBWriter
2727

2828
__all__ = (
29-
"compute_rdf",
30-
"compute_acf",
31-
"build_bcc_lattice",
32-
"build_fcc_lattice",
33-
"build_cubic_lattice",
34-
"build_random_cell",
35-
"ForceField",
36-
"NBuildSimple",
37-
"NBuildCellLists",
3829
"CutOffWrapper",
30+
"ForceField",
3931
"LennardJones",
40-
"PairwiseTerm",
32+
"NBuildCellLists",
33+
"NBuildSimple",
4134
"NPYWriter",
4235
"PDBWriter",
36+
"PairwiseTerm",
37+
"build_bcc_lattice",
38+
"build_cubic_lattice",
39+
"build_fcc_lattice",
40+
"build_random_cell",
41+
"compute_acf",
42+
"compute_rdf",
4343
)
4444

4545
try:

src/tinyff/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from .neighborlist import NBuild
2626

27-
__all__ = ("compute_rdf", "compute_acf")
27+
__all__ = ("compute_acf", "compute_rdf")
2828

2929

3030
def compute_rdf(

src/tinyff/atomsmithy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
from .pairwise import CheapRepulsion
2828

2929
__all__ = (
30-
"build_general_cubic_lattice",
31-
"build_cubic_lattice",
3230
"build_bcc_lattice",
31+
"build_cubic_lattice",
3332
"build_fcc_lattice",
33+
"build_general_cubic_lattice",
3434
"build_random_cell",
3535
)
3636

src/tinyff/forcefield.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .neighborlist import NLIST_DTYPE, NBuild
2626
from .pairwise import PairwiseTerm
2727

28-
__all__ = ("Move", "ForceField")
28+
__all__ = ("ForceField", "Move")
2929

3030

3131
@attrs.define

src/tinyff/neighborlist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from .utils import parse_atpos, parse_cell_lengths
2626

27-
__all__ = ("NLIST_DTYPE", "NBuildSimple", "NBuildCellLists")
27+
__all__ = ("NLIST_DTYPE", "NBuildCellLists", "NBuildSimple")
2828

2929

3030
NLIST_DTYPE = [

src/tinyff/pairwise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from .neighborlist import NLIST_DTYPE
2626

27-
__all__ = ("PairwiseTerm", "LennardJones", "CutOffWrapper", "CheapRepulsion")
27+
__all__ = ("CheapRepulsion", "CutOffWrapper", "LennardJones", "PairwiseTerm")
2828

2929

3030
@attrs.define

src/tinyff/trajectory.py

Lines changed: 123 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,128 @@
3636

3737
from .utils import parse_atpos, parse_cell_lengths
3838

39-
__all__ = ("PDBWriter", "NPYWriter")
39+
__all__ = ("NPYWriter", "PDBWriter")
4040

41-
SYMBOLS = """
42-
H He Li Be B C N O F Ne Na Mg Al Si P S Cl Ar K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn
43-
Ga Ge As Se Br Kr Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe Cs Ba La
44-
Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po
45-
At Rn Fr Ra Ac Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr Rf Db Sg Bh Hs Mt Ds Rg
46-
Cn Nh Fl Mc Lv Ts Og""".split()
41+
SYMBOLS = [
42+
"H",
43+
"He",
44+
"Li",
45+
"Be",
46+
"B",
47+
"C",
48+
"N",
49+
"O",
50+
"F",
51+
"Ne",
52+
"Na",
53+
"Mg",
54+
"Al",
55+
"Si",
56+
"P",
57+
"S",
58+
"Cl",
59+
"Ar",
60+
"K",
61+
"Ca",
62+
"Sc",
63+
"Ti",
64+
"V",
65+
"Cr",
66+
"Mn",
67+
"Fe",
68+
"Co",
69+
"Ni",
70+
"Cu",
71+
"Zn",
72+
"Ga",
73+
"Ge",
74+
"As",
75+
"Se",
76+
"Br",
77+
"Kr",
78+
"Rb",
79+
"Sr",
80+
"Y",
81+
"Zr",
82+
"Nb",
83+
"Mo",
84+
"Tc",
85+
"Ru",
86+
"Rh",
87+
"Pd",
88+
"Ag",
89+
"Cd",
90+
"In",
91+
"Sn",
92+
"Sb",
93+
"Te",
94+
"I",
95+
"Xe",
96+
"Cs",
97+
"Ba",
98+
"La",
99+
"Ce",
100+
"Pr",
101+
"Nd",
102+
"Pm",
103+
"Sm",
104+
"Eu",
105+
"Gd",
106+
"Tb",
107+
"Dy",
108+
"Ho",
109+
"Er",
110+
"Tm",
111+
"Yb",
112+
"Lu",
113+
"Hf",
114+
"Ta",
115+
"W",
116+
"Re",
117+
"Os",
118+
"Ir",
119+
"Pt",
120+
"Au",
121+
"Hg",
122+
"Tl",
123+
"Pb",
124+
"Bi",
125+
"Po",
126+
"At",
127+
"Rn",
128+
"Fr",
129+
"Ra",
130+
"Ac",
131+
"Th",
132+
"Pa",
133+
"U",
134+
"Np",
135+
"Pu",
136+
"Am",
137+
"Cm",
138+
"Bk",
139+
"Cf",
140+
"Es",
141+
"Fm",
142+
"Md",
143+
"No",
144+
"Lr",
145+
"Rf",
146+
"Db",
147+
"Sg",
148+
"Bh",
149+
"Hs",
150+
"Mt",
151+
"Ds",
152+
"Rg",
153+
"Cn",
154+
"Nh",
155+
"Fl",
156+
"Mc",
157+
"Lv",
158+
"Ts",
159+
"Og",
160+
]
47161

48162

49163
@attrs.define
@@ -104,7 +218,7 @@ def _dump_low(self, fh: TextIO, atpos: ArrayLike, cell_lengths: ArrayLike):
104218
for i, (x, y, z) in enumerate(atpos * self.to_angstrom):
105219
symbol = SYMBOLS[self.atnums[i] - 1]
106220
print(
107-
f"HETATM{i+1:5d} {symbol:2s} ATM 1 {x:8.3f}{y:8.3f}{z:8.3f}"
221+
f"HETATM{i + 1:5d} {symbol:2s} ATM 1 {x:8.3f}{y:8.3f}{z:8.3f}"
108222
f" 1.00 1.00 {symbol:2s}",
109223
file=fh,
110224
)
@@ -164,8 +278,7 @@ def dump_each(self, **kwargs):
164278
# Check kwargs
165279
if set(self.fields) != set(kwargs):
166280
raise TypeError(
167-
f"Received keys: {list(kwargs.keys())}. "
168-
f"Expected: {list(self.fields.keys())}"
281+
f"Received keys: {list(kwargs.keys())}. Expected: {list(self.fields.keys())}"
169282
)
170283
for key, value in kwargs.items():
171284
arvalue = np.asarray(value)

0 commit comments

Comments
 (0)