diff --git a/docs/conf.py b/docs/conf.py index a40422d3..263cb550 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ # -- Project information ----------------------------------------------------- project = "dpdata" -copyright = "2019-%d, DeepModeling " % date.today().year +copyright = "2019-%d, DeepModeling " % date.today().year # noqa: UP031 author = "Han Wang" # The short X.Y version diff --git a/tests/poscars/poscar_ref_oh.py b/tests/poscars/poscar_ref_oh.py index 2d29aeeb..39299ff8 100644 --- a/tests/poscars/poscar_ref_oh.py +++ b/tests/poscars/poscar_ref_oh.py @@ -32,7 +32,7 @@ def test_cell(self): self.system.data["cells"][0][ii][jj], ovito_cell[ii][jj], places=6, - msg="cell[%d][%d] failed" % (ii, jj), + msg="cell[%d][%d] failed" % (ii, jj), # noqa: UP031 ) def test_frame(self): @@ -48,5 +48,5 @@ def test_frame(self): self.system.data["coords"][0][ii][jj], ovito_posis[ii][jj], places=6, - msg="posis[%d][%d] failed" % (ii, jj), + msg="posis[%d][%d] failed" % (ii, jj), # noqa: UP031 ) diff --git a/tests/pwmat/config_ref_ch4.py b/tests/pwmat/config_ref_ch4.py index 72499398..bb76f6cf 100644 --- a/tests/pwmat/config_ref_ch4.py +++ b/tests/pwmat/config_ref_ch4.py @@ -35,7 +35,7 @@ def test_cell(self): self.system.data["cells"][0][ii][jj], ovito_cell[ii][jj], places=6, - msg="cell[%d][%d] failed" % (ii, jj), + msg="cell[%d][%d] failed" % (ii, jj), # noqa: UP031 ) def test_frame(self): @@ -57,5 +57,5 @@ def test_frame(self): self.system.data["coords"][0][ii][jj], ovito_posis[ii][jj], places=6, - msg="posis[%d][%d] failed" % (ii, jj), + msg="posis[%d][%d] failed" % (ii, jj), # noqa: UP031 ) diff --git a/tests/pwmat/config_ref_oh.py b/tests/pwmat/config_ref_oh.py index ad546019..cde0e3ec 100644 --- a/tests/pwmat/config_ref_oh.py +++ b/tests/pwmat/config_ref_oh.py @@ -32,7 +32,7 @@ def test_cell(self): self.system.data["cells"][0][ii][jj], ovito_cell[ii][jj], places=6, - msg="cell[%d][%d] failed" % (ii, jj), + msg="cell[%d][%d] failed" % (ii, jj), # noqa: UP031 ) def test_frame(self): @@ -43,5 +43,5 @@ def test_frame(self): self.system.data["coords"][0][ii][jj], ovito_posis[ii][jj], places=6, - msg="posis[%d][%d] failed" % (ii, jj), + msg="posis[%d][%d] failed" % (ii, jj), # noqa: UP031 ) diff --git a/tests/test_custom_data_type.py b/tests/test_custom_data_type.py index 230475ab..08dc9eba 100644 --- a/tests/test_custom_data_type.py +++ b/tests/test_custom_data_type.py @@ -120,4 +120,6 @@ def test_to_deepmd_hdf5(self): def test_from_deepmd_hdf5(self): self.system.to_deepmd_hdf5("data_bar.h5") x = dpdata.LabeledSystem("data_bar.h5", fmt="deepmd/hdf5") + print(self.system.data.keys()) + print(x.data.keys()) np.testing.assert_allclose(x.data["bar"], self.bar) diff --git a/tests/test_msd.py b/tests/test_msd.py index 7148b0b5..5d26db64 100644 --- a/tests/test_msd.py +++ b/tests/test_msd.py @@ -28,6 +28,6 @@ def test_msd(self): # print(msd) ncomp = msd.shape[0] for ii in range(ncomp): - self.assertAlmostEqual(msd0[ii], ii * ii, msg="msd0[%d]" % ii) - self.assertAlmostEqual(msd1[ii], ii * ii * 4, msg="msd1[%d]" % ii) - self.assertAlmostEqual(msd[ii], (msd0[ii] + msd1[ii]) * 0.5, "msd[%d]" % ii) + self.assertAlmostEqual(msd0[ii], ii * ii, msg="msd0[%d]" % ii) # noqa: UP031 + self.assertAlmostEqual(msd1[ii], ii * ii * 4, msg="msd1[%d]" % ii) # noqa: UP031 + self.assertAlmostEqual(msd[ii], (msd0[ii] + msd1[ii]) * 0.5, "msd[%d]" % ii) # noqa: UP031 diff --git a/tests/test_remove_pbc.py b/tests/test_remove_pbc.py index d70a2f02..7770b6fd 100644 --- a/tests/test_remove_pbc.py +++ b/tests/test_remove_pbc.py @@ -39,7 +39,7 @@ def test_remove(self): self.assertAlmostEqual( sys["cells"][ff][ii][jj], ref[ii][jj], - msg="%d %d %d" % (ff, ii, jj), + msg="%d %d %d" % (ff, ii, jj), # noqa: UP031 ) dists = [] for ii in range(sys.get_natoms()): diff --git a/tests/test_system_apply_pbc.py b/tests/test_system_apply_pbc.py index 2114cf6a..22dab3ba 100644 --- a/tests/test_system_apply_pbc.py +++ b/tests/test_system_apply_pbc.py @@ -27,7 +27,7 @@ def test_pbc(self): self.assertAlmostEqual( sys["coords"][ii][jj][dd], bk_coord[ii][jj][dd], - msg="coord[%d][%d][%d] failed" % (ii, jj, dd), + msg="coord[%d][%d][%d] failed" % (ii, jj, dd), # noqa: UP031 )