def unpack_variables(ds: Dataset, dtype: DType='float32') -> Dataset:
    gp = ds['call_genotype_probability'].astype(dtype)
    if (gp.sizes['genotypes'] != 2):
        raise ValueError(f"Expecting variable 'call_genotype_probability' to have genotypes dimension of size 2 (received sizes = {dict(gp.sizes)})")
    ds = ds.drop_vars('call_genotype_probability')
    ds['call_genotype_probability'] = xr.concat([(1 - gp.sum(dim='genotypes', skipna=False)), gp], dim='genotypes')
    ds['call_dosage'] = (gp[(..., 0)] + (2 * gp[(..., 1)]))
    ds['call_dosage_mask'] = ds['call_genotype_probability_mask']
    ds['call_genotype_probability_mask'] = ds['call_genotype_probability_mask'].broadcast_like(ds['call_genotype_probability'])
    return ds
def unpack_variables(ds: Dataset, dtype: DType='float32') -> Dataset:
    gp = ds['call_genotype_probability'].astype(dtype)
    if (gp.sizes['genotypes'] != 2):
        raise ValueError(f"Expecting variable 'call_genotype_probability' to have genotypes dimension of size 2 (received sizes = {dict(gp.sizes)})")
    ds = ds.drop_vars('call_genotype_probability')
    ds['call_genotype_probability'] = xr.concat([(1 - gp.sum(dim='genotypes', skipna=False)), gp], dim='genotypes')
    ds['call_dosage'] = (gp[(..., 0)] + (2 * gp[(..., 1)]))
    ds['call_dosage_mask'] = ds['call_genotype_probability_mask']
    ds['call_genotype_probability_mask'] = ds['call_genotype_probability_mask'].broadcast_like(ds['call_genotype_probability'])
    return ds