def _test_table_row(self, targets): """Test cuts work with tables from several I/O libraries """ # ADM only test the ELG cuts for speed. There's a # ADM full run through all classes in test_cuts_basic. tc = ["ELG"] # ADM add the DR7/DR8 data columns if they aren't there yet. # ADM can remove this once DR8 is finalized. if "MASKBITS" not in targets.dtype.names: targets = io.add_dr8_columns(targets) self.assertFalse(cuts._is_row(targets)) self.assertTrue(cuts._is_row(targets[0])) desi, bgs, mws = cuts.apply_cuts(targets, tcnames=tc) self.assertEqual(len(desi), len(targets)) self.assertEqual(len(bgs), len(targets)) self.assertEqual(len(mws), len(targets)) desi, bgs, mws = cuts.apply_cuts(targets[0], tcnames=tc) self.assertTrue(isinstance(desi, numbers.Integral), 'DESI_TARGET mask not an int') self.assertTrue(isinstance(bgs, numbers.Integral), 'BGS_TARGET mask not an int') self.assertTrue(isinstance(mws, numbers.Integral), 'MWS_TARGET mask not an int')
def _test_table_row(self, targets): """Test cuts work with tables from several I/O libraries """ # ADM add the DR7/DR8 data columns if they aren't there yet. # ADM can remove this once DR8 is finalized. if "MASKBITS" not in targets.dtype.names: targets = io.add_dr8_columns(targets) cmx, pshift = cuts.apply_cuts(targets, cmxdir=self.cmxdir) self.assertEqual(len(cmx), len(targets)) cmx, pshift = cuts.apply_cuts(targets[0], cmxdir=self.cmxdir) self.assertTrue(isinstance(cmx, numbers.Integral), 'CMX_TARGET mask not an int')