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 #613

Merged
merged 2 commits into from
Mar 13, 2024
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
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 @@
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"

Check warning on line 71 in dpdata/vasp/xml.py

View check run for this annotation

Codecov / codecov/patch

dpdata/vasp/xml.py#L71

Added line #L71 was not covered by tests
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
Loading