def ancestors(parent_table, cycle_idx, walker_idx, ancestor_cycle=0):
    """Given a parent table, step_idx, and walker idx returns the
    ancestor at a given cycle of the walker.

    Input:

    parent: table (n_cycles x n_walkers numpy array): It describes
    how the walkers merged and cloned during the WExplore simulation .

    cycle_idx:

    walker_idx:

    ancestor_cycle:


    Output:

    ancestors: A list of 2x1 tuples indicating the
                   walker and cycle parents

    """
    lineage = [(walker_idx, cycle_idx)]
    previous_walker = walker_idx
    for curr_cycle_idx in range(cycle_idx - 1, ancestor_cycle - 1, -1):
        previous_walker = parent_table[curr_cycle_idx][previous_walker]
        if previous_walker == -1:
            break
        previous_point = previous_walker, curr_cycle_idx
        lineage.insert(0, previous_point)
    return lineage
