def _disjoint_time_sets(ts1, ts2):
    if len(ts1) == 0 or len(ts2) == 0:
        return True
    min1, min2 = map(np.nanmin, [ts1, ts2])
    max1, max2 = map(np.nanmax, [ts1, ts2])
    return max1 < min2 or max2 < min1