Skip to content
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- id: black-jupyter
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.284
rev: v0.0.285
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -35,7 +35,7 @@ repos:
args: ["--write"]
# Python inside docs
- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs
ci:
Expand Down
2 changes: 1 addition & 1 deletion dpdata/abacus/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_frame(fname):
data["energies"] = energy
data["forces"] = force
data["virials"] = stress
if type(data["virials"]) != np.ndarray:
if not isinstance(data["virials"], np.ndarray):
del data["virials"]
data["orig"] = np.zeros(3)

Expand Down
4 changes: 2 additions & 2 deletions dpdata/md/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def _compute_rdf_1frame(box, posis, atype, sel_type=[None, None], max_r=5, nbins
sel_type[0] = all_types
if sel_type[1] is None:
sel_type[1] = all_types
if type(sel_type[0]) is not list:
if not isinstance(sel_type[0], list):
sel_type[0] = [sel_type[0]]
if type(sel_type[1]) is not list:
if not isinstance(sel_type[1], list):
sel_type[1] = [sel_type[1]]
natoms = len(posis)
import ase.neighborlist
Expand Down
2 changes: 1 addition & 1 deletion dpdata/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def check_type_map(self, type_map):
self.sort_atom_names(type_map=type_map)

def apply_type_map(self, type_map):
if type_map is not None and type(type_map) is list:
if type_map is not None and isinstance(type_map, list):
self.check_type_map(type_map)
else:
raise RuntimeError("invalid type map, cannot be applied")
Expand Down
1 change: 1 addition & 0 deletions plugin_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pip install .

```py
import dpdata

print(dpdata.System(12, fmt="random"))
```

Expand Down