コード例 #1
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_val(self):
     """Delta class value, same percentage equality.
     """
     d = Delta("+-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
コード例 #2
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_val(self):
     """Delta class value, different absolute.
     """
     d = Delta("+2.5-1.5")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 3), False)
     self.assertEquals(d.cmp(3, 1), True)
コード例 #3
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_val(self):
     """Delta class value, same absolute equality.
     """
     d = Delta("+-3.0=")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 4), True)
     self.assertEquals(d.cmp(4, 1), True)
コード例 #4
0
 def test_delta_val(self):
     """Delta class value, same percentage equality.
     """
     d = Delta("+-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
コード例 #5
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_sign(self):
     """Delta class sign.
     """
     d = Delta("+-")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(-1, 0), False)
     self.assertEquals(d.cmp(-1, 1), True)
コード例 #6
0
 def test_delta_val(self):
     """Delta class value, same absolute equality.
     """
     d = Delta("+-3.0=")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 4), True)
     self.assertEquals(d.cmp(4, 1), True)
コード例 #7
0
 def test_delta_val(self):
     """Delta class value, different absolute.
     """
     d = Delta("+2.5-1.5")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(1, 3), False)
     self.assertEquals(d.cmp(3, 1), True)
コード例 #8
0
 def test_delta_sign(self):
     """Delta class sign.
     """
     d = Delta("+-")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(-1, 0), False)
     self.assertEquals(d.cmp(-1, 1), True)
コード例 #9
0
ファイル: test_diff.py プロジェクト: zhangrz1983/pymatgen-db
 def test_delta_val(self):
     """Delta class value, same absolute.
     """
     d = Delta("+-3")
     self.assertEqual(d.cmp(0, 1), False)
     self.assertEqual(d.cmp(1, 4), False)
     self.assertEqual(d.cmp(1, 5), True)
コード例 #10
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_val(self):
     """Delta class value, different percentage equality.
     """
     d = Delta("+50-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
     self.assertEquals(d.cmp(6, 8), False)
     self.assertEquals(d.cmp(6, 9), True)
コード例 #11
0
 def test_delta_val(self):
     """Delta class value, different percentage equality.
     """
     d = Delta("+50-25=%")
     self.assertEquals(d.cmp(0, 1), False)
     self.assertEquals(d.cmp(8, 4), True)
     self.assertEquals(d.cmp(8, 6), True)
     self.assertEquals(d.cmp(6, 8), False)
     self.assertEquals(d.cmp(6, 9), True)
コード例 #12
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_minus(self):
     """Delta class value 'minus only'.
     """
     d = Delta("-50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(51, 0), True)
     self.assertEquals(d.cmp(5, 10), False)
     d = Delta("-50=")
     self.assertEquals(d.cmp(50, 0), True)
     d = Delta("-50%")
     self.assertEquals(d.cmp(25, 10), True)
     self.assertEquals(d.cmp(10, 25), False)
コード例 #13
0
ファイル: test_diff.py プロジェクト: alayers2/pymatgen-db
 def test_delta_plus(self):
     """Delta class value 'plus only'.
     """
     d = Delta("+50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(0, 51), True)
     self.assertEquals(d.cmp(10, 5), False)
     d = Delta("+50=")
     self.assertEquals(d.cmp(0, 50), True)
     d = Delta("+50%")
     self.assertEquals(d.cmp(10, 25), True)
     self.assertEquals(d.cmp(25, 10), False)
コード例 #14
0
 def test_delta_minus(self):
     """Delta class value 'minus only'.
     """
     d = Delta("-50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(51, 0), True)
     self.assertEquals(d.cmp(5, 10), False)
     d = Delta("-50=")
     self.assertEquals(d.cmp(50, 0), True)
     d = Delta("-50%")
     self.assertEquals(d.cmp(25, 10), True)
     self.assertEquals(d.cmp(10, 25), False)
コード例 #15
0
 def test_delta_plus(self):
     """Delta class value 'plus only'.
     """
     d = Delta("+50")
     self.assertEquals(d.cmp(0, 50), False)
     self.assertEquals(d.cmp(0, 51), True)
     self.assertEquals(d.cmp(10, 5), False)
     d = Delta("+50=")
     self.assertEquals(d.cmp(0, 50), True)
     d = Delta("+50%")
     self.assertEquals(d.cmp(10, 25), True)
     self.assertEquals(d.cmp(25, 10), False)