def do_makesamples(args): settings = Settings( num_samples=args.num_samples, block_variables=args.block, condition_variables=args.condition, stat='f') schema = load_schema(args.schema) input = Input.from_raw_file(args.infile, schema, limit=1) job = Job(input=input, settings=settings, schema=schema) res = an.new_sample_indexes(job) if args.output is None: output = sys.stdout else: output = args.output output.write("# Block layout: " + str(job.block_layout) + "\n") output.write("# Condition layout: " + str(job.condition_layout) + "\n") test = GroupSymbols(job.condition_layout) for row in res: for x in row: output.write(' {:3d}'.format(x)) output.write(" # " + test(np.array(row)) + "\n")
def gen_sample_indexes(path): logging.info("Generating sample indexes for " + str(path)) job = load_job(path) with h5py.File(path, 'r+') as db: indexes = an.new_sample_indexes(job) db.create_dataset("sample_indexes", data=indexes)