コード例 #1
0
ファイル: count_if.py プロジェクト: realead/cykhash
 def time_countif(self):
     count_if_pyobject(self.query, self.set)
コード例 #2
0
ファイル: test_count_if.py プロジェクト: realead/cykhash
 def test_count_if_all(self):
     s=PyObjectSet_from([2,4,666])
     a=np.array([2,4,666]*6, dtype=np.object)
     result=count_if_pyobject(a,s)
     self.assertEqual(result, 18)
コード例 #3
0
ファイル: test_count_if.py プロジェクト: realead/cykhash
 def test_dbnone(self):
     a=np.array([1], dtype=np.object)
     self.assertEqual(count_if_pyobject(a,None), 0)
コード例 #4
0
ファイル: test_count_if.py プロジェクト: realead/cykhash
 def test_memview_none(self):
     s=PyObjectSet_from([])
     self.assertEqual(count_if_pyobject(None,s), 0)
コード例 #5
0
ファイル: test_count_if.py プロジェクト: realead/cykhash
 def test_count_if_empty_set(self):
     s=PyObjectSet_from([])
     a=np.array([1], dtype=np.object)
     result=count_if_pyobject(a,s)
     self.assertEqual(result, 0)
コード例 #6
0
ファイル: test_count_if.py プロジェクト: realead/cykhash
 def test_count_if_but_last(self):
     s=PyObjectSet_from([2,4,666])
     a=np.array([2,4,666]*6+[2, 1], dtype=np.object)
     result=count_if_pyobject(a,s)
     self.assertEqual(result, 19)