Example #1
0
 def test_filter_by_shape(self):
     rmin = 50
     rmax = 1000
     cmin = 200
     cmax = 5000
     matrices = p.search(rowbounds = (rmin, rmax), colbounds=(cmin, cmax))
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertTrue(matrix.rows >= rmin and matrix.rows <= rmax and matrix.cols >= cmin and matrix.cols <= cmax)
Example #2
0
 def test_filter_by_shape(self):
     rmin = 50
     rmax = 1000
     cmin = 200
     cmax = 5000
     matrices = p.search(rowbounds=(rmin, rmax), colbounds=(cmin, cmax))
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertTrue(matrix.rows >= rmin and matrix.rows <= rmax
                         and matrix.cols >= cmin and matrix.cols <= cmax)
Example #3
0
def get_all_by_shape(rmin=50, rmax=1000, cmin=200, cmax=5000):
    matrices = uf.search(rowbounds=(rmin, rmax), colbounds=(cmin, cmax))

    print "Found {} matrices within the range ({}-{}) rows and ({}-{}) cols".format(
        len(matrices), rmin, rmax, cmin, cmax)
    for matrix in matrices:
        matrix.download(destpath='./matrices', extract=True)

        directory = './matrices/{}'.format(matrix.name)
        filename = '{}.mtx'.format(matrix.name)
        shutil.move(directory + '/' + filename, directory + '.mtx')
        shutil.rmtree(directory)
Example #4
0
 def test_search_by_id(self):
     m = p.search(42)
     self.assertEqual(len(m), 1)
     self.assertEqual(m[0].id, 42)
Example #5
0
 def test_filter_by_spd_false(self):
     matrices = p.search(isspd=False)
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertFalse(matrix.isspd)
Example #6
0
 def test_filter_by_rows(self):
     matrices = p.search(rowbounds=(None, 1000))
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertTrue(matrix.rows <= 1000)
Example #7
0
 def test_search_by_name(self):
     matrices = p.search("c-")
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertTrue(matrix.name.startswith("c-"))
Example #8
0
 def test_search_by_group(self):
     matrices = p.search("HB/*")
     for matrix in matrices:
         self.assertEqual(matrix.group, "HB")
Example #9
0
 def test_search_by_group(self):
     matrices = p.search("HB/*")
     for matrix in matrices:
         self.assertEqual(matrix.group, "HB")
Example #10
0
 def test_filter_by_spd_false(self):
     matrices = p.search(isspd = False)
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertFalse(matrix.isspd)
Example #11
0
 def test_search_by_id(self):
     m = p.search(42)
     self.assertEqual(len(m), 1)
     self.assertEqual(m[0].id, 42)
Example #12
0
 def test_filter_by_rows(self):
     matrices = p.search(rowbounds = (None, 1000))
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertTrue(matrix.rows <= 1000)
Example #13
0
 def test_search_by_name(self):
     matrices = p.search("c-")
     self.assertTrue(len(matrices) > 0)
     for matrix in matrices:
         self.assertTrue(matrix.name.startswith("c-"))