'Make initial `Parts` for data, split by group_var, group_key'

def _make_parts(self, data, group_var=None, group_key=None):

    if (group_var is not None):
        assert group_var.is_discrete
        (_col_data, _) = data.get_column_view(group_var)
        row_indices = [np.flatnonzero((_col_data == i)) for i in range(len(group_var.values))]
        row_groups = [RowPart(title=name, indices=ind, sortindices=None, cluster=None, cluster_ordered=None) for (name, ind) in zip(group_var.values, row_indices)]
    else:
        row_groups = [RowPart(title=None, indices=slice(0, len(data)), sortindices=None, cluster=None, cluster_ordered=None)]
    if (group_key is not None):
        col_groups = split_domain(data.domain, group_key)
        assert (len(col_groups) > 0)
        col_indices = [np.array([data.domain.index(var) for var in group]) for (_, group) in col_groups]
        col_groups = [ColumnPart(title=name, domain=d, indices=ind, cluster=None, cluster_ordered=None) for ((name, d), ind) in zip(col_groups, col_indices)]
    else:
        col_groups = [ColumnPart(title=None, indices=slice(0, len(data.domain.attributes)), domain=data.domain, cluster=None, cluster_ordered=None)]
    (minv, maxv) = (np.nanmin(data.X), np.nanmax(data.X))
    return Parts(row_groups, col_groups, span=(minv, maxv))
