Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored Mar 13, 2024
1 parent 81eb4b4 commit 46a8952
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
rev: v0.3.2
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 1 addition & 0 deletions dpdata/amber/mask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Amber mask."""

try:
import parmed
except ImportError:
Expand Down
1 change: 1 addition & 0 deletions dpdata/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command line interface for dpdata."""

import argparse
from typing import Optional

Expand Down
4 changes: 1 addition & 3 deletions dpdata/cp2k/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ def get_xyz_block_generator(self):
lines.append(self.xyz_file_object.readline())
if not lines[-1]:
raise RuntimeError(
"this xyz file may lack of lines, should be {};lines:{}".format(
atom_num + 2, lines
)
f"this xyz file may lack of lines, should be {atom_num + 2};lines:{lines}"
)
yield lines

Expand Down
1 change: 1 addition & 0 deletions dpdata/deepmd/hdf5.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils for deepmd/hdf5 format."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions dpdata/driver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Driver plugin system."""

from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Callable, List, Union

Expand Down
1 change: 1 addition & 0 deletions dpdata/format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implement the format plugin system."""

import os
from abc import ABC

Expand Down
4 changes: 1 addition & 3 deletions dpdata/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,9 +1334,7 @@ def __repr__(self):
return self.__str__()

def __str__(self):
return "MultiSystems ({} systems containing {} frames)".format(
len(self.systems), self.get_nframes()
)
return f"MultiSystems ({len(self.systems)} systems containing {self.get_nframes()} frames)"

def __add__(self, others):
"""Magic method "+" operation."""
Expand Down
9 changes: 1 addition & 8 deletions dpdata/vasp/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,7 @@ def formulate_config(eles, types, posi, cell, ener, forc, strs_):
ret += f"#Z {cell[2][0]:13.8f} {cell[2][1]:13.8f} {cell[2][2]:13.8f}\n"
ret += "#W 1.0\n"
ret += "#E %.10f\n" % (ener / natoms)
ret += "#S {:.9e} {:.9e} {:.9e} {:.9e} {:.9e} {:.9e}\n".format(
strs[0][0],
strs[1][1],
strs[2][2],
strs[0][1],
strs[1][2],
strs[0][2],
)
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"
ret += "#F\n"
for ii in range(natoms):
sp = np.matmul(cell.T, posi[ii])
Expand Down
4 changes: 1 addition & 3 deletions dpdata/xyz/quip_gap_xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def get_block_generator(self):
lines.append(self.file_object.readline())
if not lines[-1]:
raise RuntimeError(
"this xyz file may lack of lines, should be {};lines:{}".format(
atom_num + 2, lines
)
f"this xyz file may lack of lines, should be {atom_num + 2};lines:{lines}"
)
yield lines

Expand Down

0 comments on commit 46a8952

Please sign in to comment.