Skip to content

Commit 72d5626

Browse files
[pre-commit.ci] pre-commit autoupdate (#528)
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](astral-sh/ruff-pre-commit@v0.0.284...v0.0.285) - [github.com/asottile/blacken-docs: 1.15.0 → 1.16.0](adamchainz/blacken-docs@1.15.0...1.16.0) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
1 parent 5db6410 commit 72d5626

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
- id: black-jupyter
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
2525
# Ruff version.
26-
rev: v0.0.284
26+
rev: v0.0.285
2727
hooks:
2828
- id: ruff
2929
args: ["--fix"]
@@ -35,7 +35,7 @@ repos:
3535
args: ["--write"]
3636
# Python inside docs
3737
- repo: https://github.com/asottile/blacken-docs
38-
rev: 1.15.0
38+
rev: 1.16.0
3939
hooks:
4040
- id: blacken-docs
4141
ci:

dpdata/abacus/md.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def get_frame(fname):
206206
data["energies"] = energy
207207
data["forces"] = force
208208
data["virials"] = stress
209-
if type(data["virials"]) != np.ndarray:
209+
if not isinstance(data["virials"], np.ndarray):
210210
del data["virials"]
211211
data["orig"] = np.zeros(3)
212212

dpdata/md/rdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def _compute_rdf_1frame(box, posis, atype, sel_type=[None, None], max_r=5, nbins
6262
sel_type[0] = all_types
6363
if sel_type[1] is None:
6464
sel_type[1] = all_types
65-
if type(sel_type[0]) is not list:
65+
if not isinstance(sel_type[0], list):
6666
sel_type[0] = [sel_type[0]]
67-
if type(sel_type[1]) is not list:
67+
if not isinstance(sel_type[1], list):
6868
sel_type[1] = [sel_type[1]]
6969
natoms = len(posis)
7070
import ase.neighborlist

dpdata/system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def check_type_map(self, type_map):
509509
self.sort_atom_names(type_map=type_map)
510510

511511
def apply_type_map(self, type_map):
512-
if type_map is not None and type(type_map) is list:
512+
if type_map is not None and isinstance(type_map, list):
513513
self.check_type_map(type_map)
514514
else:
515515
raise RuntimeError("invalid type map, cannot be applied")

plugin_example/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pip install .
66

77
```py
88
import dpdata
9+
910
print(dpdata.System(12, fmt="random"))
1011
```
1112

0 commit comments

Comments
 (0)