From e14dd99f304b7ae4d235755cf0eb0811d0d5759a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 02:27:30 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30c86388a..fd10628c3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 From d16b673d37869afbdaca78941599d3b8f45082bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 02:27:50 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dpdata/bond_order_system.py | 2 +- dpdata/cli.py | 2 +- dpdata/cp2k/cell.py | 2 +- dpdata/cp2k/output.py | 6 +++--- dpdata/fhi_aims/output.py | 2 -- dpdata/plugins/3dmol.py | 2 +- dpdata/plugins/ase.py | 2 +- dpdata/plugins/deepmd.py | 6 +++--- dpdata/siesta/aiMD_output.py | 1 + dpdata/system.py | 2 +- dpdata/xyz/quip_gap_xyz.py | 2 +- tests/test_cp2k_aimd_output.py | 6 +++--- tests/test_pwmat_mlmd.py | 1 - tests/test_vasp_unconverged_outcar.py | 1 - 14 files changed, 17 insertions(+), 20 deletions(-) diff --git a/dpdata/bond_order_system.py b/dpdata/bond_order_system.py index 124a6faa5..55ec0fe28 100644 --- a/dpdata/bond_order_system.py +++ b/dpdata/bond_order_system.py @@ -1,4 +1,4 @@ -#%% +# %% # Bond Order System from copy import deepcopy diff --git a/dpdata/cli.py b/dpdata/cli.py index c80de99c2..6bf7e5713 100644 --- a/dpdata/cli.py +++ b/dpdata/cli.py @@ -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. diff --git a/dpdata/cp2k/cell.py b/dpdata/cp2k/cell.py index 33e566371..0cd6151e3 100644 --- a/dpdata/cp2k/cell.py +++ b/dpdata/cp2k/cell.py @@ -1,4 +1,4 @@ -#%% +# %% import re from collections import OrderedDict diff --git a/dpdata/cp2k/output.py b/dpdata/cp2k/output.py index f7b94f252..a29f4221f 100644 --- a/dpdata/cp2k/output.py +++ b/dpdata/cp2k/output.py @@ -1,4 +1,4 @@ -#%% +# %% import re from collections import OrderedDict @@ -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() @@ -370,7 +370,7 @@ def handle_single_xyz_frame(self, lines): return info_dict -#%% +# %% def get_frames(fname): diff --git a/dpdata/fhi_aims/output.py b/dpdata/fhi_aims/output.py index 9706b91a8..17526c182 100755 --- a/dpdata/fhi_aims/output.py +++ b/dpdata/fhi_aims/output.py @@ -14,7 +14,6 @@ def get_info(lines, type_idx_zero=False): - atom_types = [] atom_names = [] cell = [] @@ -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))]: diff --git a/dpdata/plugins/3dmol.py b/dpdata/plugins/3dmol.py index 3b463abb3..68c3769b0 100644 --- a/dpdata/plugins/3dmol.py +++ b/dpdata/plugins/3dmol.py @@ -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. diff --git a/dpdata/plugins/ase.py b/dpdata/plugins/ase.py index 9a626be8e..d6ed4f02a 100644 --- a/dpdata/plugins/ase.py +++ b/dpdata/plugins/ase.py @@ -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. diff --git a/dpdata/plugins/deepmd.py b/dpdata/plugins/deepmd.py index 499e23b21..770d2f9ba 100644 --- a/dpdata/plugins/deepmd.py +++ b/dpdata/plugins/deepmd.py @@ -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. @@ -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. @@ -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. diff --git a/dpdata/siesta/aiMD_output.py b/dpdata/siesta/aiMD_output.py index 32cb081fb..c76ff8895 100644 --- a/dpdata/siesta/aiMD_output.py +++ b/dpdata/siesta/aiMD_output.py @@ -5,6 +5,7 @@ ev2ev = 1 ang2ang = 1 + #############################read output##################################### def get_single_line_tail(fin, keyword, num=1): file = open(fin, "r") diff --git a/dpdata/system.py b/dpdata/system.py index 802b352c5..9d955a58d 100644 --- a/dpdata/system.py +++ b/dpdata/system.py @@ -1,4 +1,4 @@ -#%% +# %% import glob import inspect import os diff --git a/dpdata/xyz/quip_gap_xyz.py b/dpdata/xyz/quip_gap_xyz.py index a0b9fd4a7..dceeade20 100644 --- a/dpdata/xyz/quip_gap_xyz.py +++ b/dpdata/xyz/quip_gap_xyz.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -#%% +# %% import re from collections import OrderedDict diff --git a/tests/test_cp2k_aimd_output.py b/tests/test_cp2k_aimd_output.py index f87804267..34c139d31 100644 --- a/tests/test_cp2k_aimd_output.py +++ b/tests/test_cp2k_aimd_output.py @@ -1,4 +1,4 @@ -#%% +# %% import os import unittest @@ -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") @@ -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) diff --git a/tests/test_pwmat_mlmd.py b/tests/test_pwmat_mlmd.py index ae2d1334e..4a920c150 100644 --- a/tests/test_pwmat_mlmd.py +++ b/tests/test_pwmat_mlmd.py @@ -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) diff --git a/tests/test_vasp_unconverged_outcar.py b/tests/test_vasp_unconverged_outcar.py index 97318223c..4e48a71ab 100644 --- a/tests/test_vasp_unconverged_outcar.py +++ b/tests/test_vasp_unconverged_outcar.py @@ -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)