def test_get_info(): data_file = op.join( testdir, 'data', 'dixon2012-h1hesc-hindiii-allreps-filtered.1000kb.multires.cool') info = cch.get_info(data_file) assert ('transforms' in info)
def test_get_info(self): filepath = ( 'data/dixon2012-h1hesc-hindiii-allreps-filtered.1000kb.multires.cool' ) info = cch.get_info(filepath) self.assertEqual(info['max_zoom'], 4) self.assertEqual(info['max_width'], 1000000 * 2**12)
def check_tile(self, z, x, y): returned = json.loads( self.client.get('/api/v1/tiles/?d={uuid}.{z}.{x}.{y}'.format( uuid=self.cooler.uuid, x=x, y=y, z=z)).content) r = base64.decodestring(returned[returned.keys()[0]]['dense']) q = np.frombuffer(r, dtype=np.float32) with h5py.File(self.cooler.datafile.url) as f: mat = [f, cch.get_info(self.cooler.datafile.url)] t = tiles.make_tile(z, x, y, mat) # test the base64 encoding self.assertTrue(np.isclose(sum(q), sum(t))) # make sure we're returning actual data self.assertGreater(sum(q), 0)
def make_mats(dset): f = h5py.File(dset, 'r') mats[dset] = [f, cch.get_info(dset)]