def _skip_0_length(p, c): '''Return the first child c with non-zero distance to parent p''' while np.all(p.value[:COLS.R] == c.value[:COLS.R])\ and not tr.is_leaf(c) and not tr.is_forking_point(c): c = c.children[0] return c