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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: check-toml
# Python
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black-jupyter
- repo: https://github.com/PyCQA/isort
Expand Down
2 changes: 1 addition & 1 deletion dpdata/bond_order_system.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%%
# %%
# Bond Order System
from copy import deepcopy

Expand Down
2 changes: 1 addition & 1 deletion dpdata/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def convert(
no_labeled: bool = False,
multi: bool = False,
type_map: Optional[list] = None,
**kwargs
**kwargs,
):
"""Convert files from one format to another one.

Expand Down
2 changes: 1 addition & 1 deletion dpdata/cp2k/cell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%%
# %%
import re
from collections import OrderedDict

Expand Down
6 changes: 3 additions & 3 deletions dpdata/cp2k/output.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%%
# %%
import re
from collections import OrderedDict

Expand All @@ -13,7 +13,7 @@
)
from .cell import cell_to_low_triangle

#%%
# %%
AU_TO_ANG = LengthConversion("bohr", "angstrom").value()
AU_TO_EV = EnergyConversion("hartree", "eV").value()
AU_TO_EV_EVERY_ANG = ForceConversion("hartree/bohr", "eV/angstrom").value()
Expand Down Expand Up @@ -370,7 +370,7 @@ def handle_single_xyz_frame(self, lines):
return info_dict


#%%
# %%


def get_frames(fname):
Expand Down
2 changes: 0 additions & 2 deletions dpdata/fhi_aims/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


def get_info(lines, type_idx_zero=False):

atom_types = []
atom_names = []
cell = []
Expand Down Expand Up @@ -159,7 +158,6 @@ def analyze_block(lines, first_blk=False, md=True):
natom = 0

if first_blk:

if md:
_tmp = re.findall(pos_patt_other, contents)[:]
for ii in _tmp[slice(int(len(_tmp) / 2), len(_tmp))]:
Expand Down
2 changes: 1 addition & 1 deletion dpdata/plugins/3dmol.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def to_system(
f_idx: int = 0,
size: Tuple[int] = (300, 300),
style: dict = {"stick": {}, "sphere": {"radius": 0.4}},
**kwargs
**kwargs,
):
"""Show 3D structure of a frame in jupyter.

Expand Down
2 changes: 1 addition & 1 deletion dpdata/plugins/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def from_multi_systems(
end: Optional[int] = None,
step: Optional[int] = None,
ase_fmt: Optional[str] = None,
**kwargs
**kwargs,
) -> "ase.Atoms":
"""Convert a ASE supported file to ASE Atoms.

Expand Down
6 changes: 3 additions & 3 deletions dpdata/plugins/deepmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def from_system(
self,
file_name: Union[str, h5py.Group, h5py.File],
type_map: Optional[List[str]] = None,
**kwargs
**kwargs,
) -> dict:
"""Convert HDF5 file to System data.

Expand Down Expand Up @@ -233,7 +233,7 @@ def from_labeled_system(
self,
file_name: Union[str, h5py.Group, h5py.File],
type_map: Optional[List[str]] = None,
**kwargs
**kwargs,
) -> dict:
"""Convert HDF5 file to LabeledSystem data.

Expand Down Expand Up @@ -263,7 +263,7 @@ def to_system(
file_name: Union[str, h5py.Group, h5py.File],
set_size: int = 5000,
comp_prec: np.dtype = np.float64,
**kwargs
**kwargs,
):
"""Convert System data to HDF5 file.

Expand Down
1 change: 1 addition & 0 deletions dpdata/siesta/aiMD_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
ev2ev = 1
ang2ang = 1


#############################read output#####################################
def get_single_line_tail(fin, keyword, num=1):
file = open(fin, "r")
Expand Down
2 changes: 1 addition & 1 deletion dpdata/system.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%%
# %%
import glob
import inspect
import os
Expand Down
2 changes: 1 addition & 1 deletion dpdata/xyz/quip_gap_xyz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
#%%
# %%
import re
from collections import OrderedDict

Expand Down
6 changes: 3 additions & 3 deletions tests/test_cp2k_aimd_output.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#%%
# %%
import os
import unittest

Expand All @@ -7,7 +7,7 @@
from context import dpdata


#%%
# %%
class TestCp2kAimdOutput(unittest.TestCase, CompLabeledSys):
def setUp(self):
self.system_1 = dpdata.LabeledSystem("cp2k/aimd", fmt="cp2k/aimd_output")
Expand Down Expand Up @@ -51,7 +51,7 @@ def setUp(self):
unittest.main()


#%%
# %%
# print(1)
# system_1 = dpda.La
# system_1 = dpdata.LabeledSystem('cp2k/restart_aimd',fmt='cp2k/aimd_output', restart=True)
Expand Down
1 change: 0 additions & 1 deletion tests/test_pwmat_mlmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def setUp(self):
)

def test_mlmd(self):

self.assertEqual(self.LabeledSystem1["energies"], -0.2197270691e03)
self.assertEqual(self.LabeledSystem1.get_nframes(), 1)
self.assertEqual(self.LabeledSystem1.get_natoms(), 5)
Expand Down
1 change: 0 additions & 1 deletion tests/test_vasp_unconverged_outcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def setUp(self):
)

def test_unconverged(self):

self.assertEqual(self.LabeledSystem1["energies"], -23.94708651)
self.assertEqual(self.LabeledSystem1.get_nframes(), 1)
self.assertEqual(self.LabeledSystem1.get_natoms(), 5)
Expand Down