def get_truth2_prop(testres, qaids=None, join_acfg=False):
    "\n        Returns:\n            tuple: (truth2_prop, prop2_mat)\n\n        CommandLine:\n            python -m wbia.expt.test_result --exec-get_truth2_prop --show\n\n        Example:\n            >>> # xdoctest: +REQUIRES(--slow)\n            >>> # ENABLE_DOCTEST\n            >>> from wbia.expt.test_result import *  # NOQA\n            >>> import wbia\n            >>> ibs, testres = wbia.testdata_expts('PZ_MTEST', a=['ctrl'])\n            >>> (truth2_prop, prop2_mat) = testres.get_truth2_prop()\n            >>> result = '(truth2_prop, prop2_mat) = %s' % str((truth2_prop, prop2_mat))\n            >>> print(result)\n            >>> ut.quit_if_noshow()\n            >>> import wbia.plottool as pt\n            >>> ut.show_if_requested()\n        "
    ibs = testres.ibs
    test_qaids = (testres.get_test_qaids() if (qaids is None) else qaids)
    truth2_prop = ut.ddict(ut.odict)
    participates = testres.get_infoprop_mat('participant', test_qaids)
    truth2_prop['gt']['aid'] = testres.get_infoprop_mat('qx2_gt_aid', test_qaids)
    truth2_prop['gf']['aid'] = testres.get_infoprop_mat('qx2_gf_aid', test_qaids)
    truth2_prop['gt']['rank'] = testres.get_infoprop_mat('qx2_gt_rank', test_qaids)
    truth2_prop['gf']['rank'] = testres.get_infoprop_mat('qx2_gf_rank', test_qaids)
    truth2_prop['gt']['score'] = testres.get_infoprop_mat('qx2_gt_raw_score', test_qaids)
    truth2_prop['gf']['score'] = testres.get_infoprop_mat('qx2_gf_raw_score', test_qaids)
    truth2_prop['gt']['score'] = np.nan_to_num(truth2_prop['gt']['score'])
    truth2_prop['gf']['score'] = np.nan_to_num(truth2_prop['gf']['score'])
    for truth in ['gt', 'gf']:
        rank_mat = truth2_prop[truth]['rank']
        flags = np.logical_and(np.isnan(rank_mat), participates)
        rank_mat[flags] = testres.get_worst_possible_rank()
    is_success = (truth2_prop['gt']['rank'] == 0)
    is_failure = np.logical_not(is_success)
    assert np.all((is_success == (truth2_prop['gt']['rank'] == 0)))
    for truth in ['gt', 'gf']:
        aid_mat = truth2_prop[truth]['aid']
        timedelta_mat = np.vstack([ibs.get_annot_pair_timedelta(test_qaids, aids) for aids in aid_mat.T]).T
        annotmatch_rowid_mat = np.vstack([ibs.get_annotmatch_rowid_from_undirected_superkey(test_qaids, aids) for aids in aid_mat.T]).T
        truth2_prop[truth]['annotmatch_rowid'] = annotmatch_rowid_mat
        truth2_prop[truth]['timedelta'] = timedelta_mat
    prop2_mat = {}
    prop2_mat['is_success'] = is_success
    prop2_mat['is_failure'] = is_failure
    prop2_mat['participates'] = participates
    groupxs = testres.get_cfgx_groupxs()

    def group_prop(val, grouped_flags, groupxs):
        nRows = len(val)
        new_shape = (nRows, len(groupxs))
        if ((val.dtype == object) or (val.dtype.type == object)):
            new_val = np.full(new_shape, None, dtype=val.dtype)
        elif ut.is_float(val):
            new_val = np.full(new_shape, np.nan, dtype=val.dtype)
        else:
            new_val = np.zeros(new_shape, dtype=val.dtype)
        grouped_vals = vt.apply_grouping(val.T, groupxs)
        _iter = enumerate(zip(grouped_flags, grouped_vals))
        for (new_col, (flags, group)) in _iter:
            (rows, cols) = np.where(flags.T)
            new_val[(rows, new_col)] = group.T[(rows, cols)]
        return new_val
    if join_acfg:
        assert ut.allsame(participates.sum(axis=1))
        grouped_flags = vt.apply_grouping(participates.T, groupxs)
        new_prop2_mat = {}
        for (key, val) in prop2_mat.items():
            new_prop2_mat[key] = group_prop(val, grouped_flags, groupxs)
        new_truth2_prop = {}
        for (truth, props) in truth2_prop.items():
            new_props = {}
            for (key, val) in props.items():
                new_props[key] = group_prop(val, grouped_flags, groupxs)
            new_truth2_prop[truth] = new_props
        prop2_mat_ = new_prop2_mat
        truth2_prop_ = new_truth2_prop
    else:
        prop2_mat_ = prop2_mat
        truth2_prop_ = truth2_prop
    return (truth2_prop_, prop2_mat_)
Returns:
    tuple: (truth2_prop, prop2_mat)

CommandLine:
    python -m wbia.expt.test_result --exec-get_truth2_prop --show

Example:
    >>> # xdoctest: +REQUIRES(--slow)
    >>> # ENABLE_DOCTEST
    >>> from wbia.expt.test_result import *  # NOQA
    >>> import wbia
    >>> ibs, testres = wbia.testdata_expts('PZ_MTEST', a=['ctrl'])
    >>> (truth2_prop, prop2_mat) = testres.get_truth2_prop()
    >>> result = '(truth2_prop, prop2_mat) = %s' % str((truth2_prop, prop2_mat))
    >>> print(result)
    >>> ut.quit_if_noshow()
    >>> import wbia.plottool as pt
    >>> ut.show_if_requested()
def get_truth2_prop(testres, qaids=None, join_acfg=False):
    "\n        Returns:\n            tuple: (truth2_prop, prop2_mat)\n\n        CommandLine:\n            python -m wbia.expt.test_result --exec-get_truth2_prop --show\n\n        Example:\n            >>> # xdoctest: +REQUIRES(--slow)\n            >>> # ENABLE_DOCTEST\n            >>> from wbia.expt.test_result import *  # NOQA\n            >>> import wbia\n            >>> ibs, testres = wbia.testdata_expts('PZ_MTEST', a=['ctrl'])\n            >>> (truth2_prop, prop2_mat) = testres.get_truth2_prop()\n            >>> result = '(truth2_prop, prop2_mat) = %s' % str((truth2_prop, prop2_mat))\n            >>> print(result)\n            >>> ut.quit_if_noshow()\n            >>> import wbia.plottool as pt\n            >>> ut.show_if_requested()\n        "
    ibs = testres.ibs
    test_qaids = (testres.get_test_qaids() if (qaids is None) else qaids)
    truth2_prop = ut.ddict(ut.odict)
    participates = testres.get_infoprop_mat('participant', test_qaids)
    truth2_prop['gt']['aid'] = testres.get_infoprop_mat('qx2_gt_aid', test_qaids)
    truth2_prop['gf']['aid'] = testres.get_infoprop_mat('qx2_gf_aid', test_qaids)
    truth2_prop['gt']['rank'] = testres.get_infoprop_mat('qx2_gt_rank', test_qaids)
    truth2_prop['gf']['rank'] = testres.get_infoprop_mat('qx2_gf_rank', test_qaids)
    truth2_prop['gt']['score'] = testres.get_infoprop_mat('qx2_gt_raw_score', test_qaids)
    truth2_prop['gf']['score'] = testres.get_infoprop_mat('qx2_gf_raw_score', test_qaids)
    truth2_prop['gt']['score'] = np.nan_to_num(truth2_prop['gt']['score'])
    truth2_prop['gf']['score'] = np.nan_to_num(truth2_prop['gf']['score'])
    for truth in ['gt', 'gf']:
        rank_mat = truth2_prop[truth]['rank']
        flags = np.logical_and(np.isnan(rank_mat), participates)
        rank_mat[flags] = testres.get_worst_possible_rank()
    is_success = (truth2_prop['gt']['rank'] == 0)
    is_failure = np.logical_not(is_success)
    assert np.all((is_success == (truth2_prop['gt']['rank'] == 0)))
    for truth in ['gt', 'gf']:
        aid_mat = truth2_prop[truth]['aid']
        timedelta_mat = np.vstack([ibs.get_annot_pair_timedelta(test_qaids, aids) for aids in aid_mat.T]).T
        annotmatch_rowid_mat = np.vstack([ibs.get_annotmatch_rowid_from_undirected_superkey(test_qaids, aids) for aids in aid_mat.T]).T
        truth2_prop[truth]['annotmatch_rowid'] = annotmatch_rowid_mat
        truth2_prop[truth]['timedelta'] = timedelta_mat
    prop2_mat = {}
    prop2_mat['is_success'] = is_success
    prop2_mat['is_failure'] = is_failure
    prop2_mat['participates'] = participates
    groupxs = testres.get_cfgx_groupxs()

    def group_prop(val, grouped_flags, groupxs):
        nRows = len(val)
        new_shape = (nRows, len(groupxs))
        if ((val.dtype == object) or (val.dtype.type == object)):
            new_val = np.full(new_shape, None, dtype=val.dtype)
        elif ut.is_float(val):
            new_val = np.full(new_shape, np.nan, dtype=val.dtype)
        else:
            new_val = np.zeros(new_shape, dtype=val.dtype)
        grouped_vals = vt.apply_grouping(val.T, groupxs)
        _iter = enumerate(zip(grouped_flags, grouped_vals))
        for (new_col, (flags, group)) in _iter:
            (rows, cols) = np.where(flags.T)
            new_val[(rows, new_col)] = group.T[(rows, cols)]
        return new_val
    if join_acfg:
        assert ut.allsame(participates.sum(axis=1))
        grouped_flags = vt.apply_grouping(participates.T, groupxs)
        new_prop2_mat = {}
        for (key, val) in prop2_mat.items():
            new_prop2_mat[key] = group_prop(val, grouped_flags, groupxs)
        new_truth2_prop = {}
        for (truth, props) in truth2_prop.items():
            new_props = {}
            for (key, val) in props.items():
                new_props[key] = group_prop(val, grouped_flags, groupxs)
            new_truth2_prop[truth] = new_props
        prop2_mat_ = new_prop2_mat
        truth2_prop_ = new_truth2_prop
    else:
        prop2_mat_ = prop2_mat
        truth2_prop_ = truth2_prop
    return (truth2_prop_, prop2_mat_)