Skip to content

Commit ba28695

Browse files
committed
cell bug fix 1
1 parent e2bf3f7 commit ba28695

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_cell_to_low_triangle.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import os
22
import numpy as np
33
import unittest
4-
from dpdata.cp2k.output import cell_to_low_triangle
4+
from context import dpdata
55

6-
class CellToLowTriangle(unittest.TestCase):
6+
class TestCellToLowTriangle(unittest.TestCase):
77
def test_func1(self):
8-
cell_1 = cell_to_low_triangle(6,6,6,np.pi*1/2, np.pi*1/2, np.pi*1/2)
8+
cell_1 = dpdata.cp2k.output.cell_to_low_triangle(6,6,6,np.pi*1/2, np.pi*1/2, np.pi*1/2)
99
cell_2 = np.asarray([[6,0,0],[0,6,0],[0,0,6]])
1010
for ii in range(3):
1111
for jj in range(3):
1212
self.assertAlmostEqual(cell_1[ii,jj], cell_2[ii,jj], places=6)
1313

1414
def test_func2(self):
15-
cell_1 = cell_to_low_triangle(6,6,6,np.pi*1/3, np.pi*1/3, np.pi*1/3)
15+
cell_1 = dpdata.cp2k.output.cell_to_low_triangle(6,6,6,np.pi*1/3, np.pi*1/3, np.pi*1/3)
1616
cell_2 = np.asarray([
1717
[6,0,0],
1818
[3,3*np.sqrt(3),0],
@@ -23,12 +23,12 @@ def test_func2(self):
2323

2424
def test_func3(self):
2525
with self.assertRaises(Exception) as c:
26-
cell_to_low_triangle(0.1,6,6,np.pi*1/2,np.pi*1/2,np.pi*1/2)
26+
dpdata.cp2k.output.cell_to_low_triangle(0.1,6,6,np.pi*1/2,np.pi*1/2,np.pi*1/2)
2727
self.assertTrue("A==0.1" in str(c.exception))
2828

2929
def test_func4(self):
3030
with self.assertRaises(Exception) as c:
31-
cell_to_low_triangle(6,6,6,np.pi*3/180,np.pi*1/2,np.pi*1/2)
31+
dpdata.cp2k.output.cell_to_low_triangle(6,6,6,np.pi*3/180,np.pi*1/2,np.pi*1/2)
3232
self.assertTrue("alpha" in str(c.exception))
3333

3434
if __name__ == '__main__':

0 commit comments

Comments
 (0)