def test_hdu(env): rules, exposures = env hdus = [fits.open(exposure)[0] for exposure in exposures] pool = mkpool(hdus) assert isinstance(pool, AssociationPool) assert REQUIRED_PARAMS.issubset(pool.colnames) assert len(pool) == len(exposures)
def test_mkpool(exposures): pool = mkpool(exposures) assert isinstance(pool, AssociationPool) assert REQUIRED_PARAMS.issubset(pool.colnames) assert len(pool) == len(exposures) filenames = [filename for filename in pool['filename']] assert set(exposures) == set(filenames)
def mkpool_cmdline(exposures): """Create a pool with optional arguments from the commandline""" args = ['pool.csv'] for column, value in OPT_COLS: args.append(f'--{column.replace("_", "-")}') args.append(f'{value}') for exposure in exposures: args.append(exposure) mkpool_args = from_cmdline(args) pool = mkpool(**mkpool_args) return pool
def mkpool_with_args(exposures): """Create a pool with all optional arguments specified""" kargs = {column: value for column, value in OPT_COLS} pool = mkpool(exposures, **kargs) return pool
def test_hdulist(exposures): hduls = [fits.open(exposure) for exposure in exposures] pool = mkpool(hduls) assert isinstance(pool, AssociationPool) assert REQUIRED_PARAMS.issubset(pool.colnames) assert len(pool) == len(exposures)