def __init__(self, path: PathType, metafile_path: Optional[PathType]=None, dtype: DType='float32') -> None:
    self.path = Path(path)
    self.metafile_path = (Path(metafile_path) if metafile_path else self.path.with_suffix('.metafile'))
    with bgen_file(self.path) as bgen:
        self.n_variants = bgen.nvariants
        self.n_samples = bgen.nsamples
        if (not self.metafile_path.exists()):
            start = time.time()
            logger.info(f"Generating BGEN metafile for '{self.path}' (this may take a while)")
            bgen.create_metafile(self.metafile_path, verbose=False)
            stop = time.time()
            logger.info(f'BGEN metafile generation complete ({(stop - start):.0f} seconds)')
        with bgen_metafile(self.metafile_path) as mf:
            assert (self.n_variants == mf.nvariants)
            self.npartitions = mf.npartitions
            self.partition_size = mf.partition_size
    self.shape = (self.n_variants, self.n_samples, 3)
    self.dtype = np.dtype(dtype)
    self.precision = (64 if (self.dtype.itemsize >= 8) else 32)
    self.ndim = 3
def __init__(self, path: PathType, metafile_path: Optional[PathType]=None, dtype: DType='float32') -> None:
    self.path = Path(path)
    self.metafile_path = (Path(metafile_path) if metafile_path else self.path.with_suffix('.metafile'))
    with bgen_file(self.path) as bgen:
        self.n_variants = bgen.nvariants
        self.n_samples = bgen.nsamples
        if (not self.metafile_path.exists()):
            start = time.time()
            logger.info(f"Generating BGEN metafile for '{self.path}' (this may take a while)")
            bgen.create_metafile(self.metafile_path, verbose=False)
            stop = time.time()
            logger.info(f'BGEN metafile generation complete ({(stop - start):.0f} seconds)')
        with bgen_metafile(self.metafile_path) as mf:
            assert (self.n_variants == mf.nvariants)
            self.npartitions = mf.npartitions
            self.partition_size = mf.partition_size
    self.shape = (self.n_variants, self.n_samples, 3)
    self.dtype = np.dtype(dtype)
    self.precision = (64 if (self.dtype.itemsize >= 8) else 32)
    self.ndim = 3