def ind_ring(ring, r):
    'returns index for closest ring r'
    rdiff = r - ring
    # find index of smallest positive rdiff
    return np.argmin(np.abs(rdiff))
dataset/ETHPy150Open mkenworthy/exorings/disk_sim.py/ind_ring/swapped operands of `-`