def merge_neighbours(self, strict=True):
new_strip = [self[<NUM_LIT:0>].copy()]<EOL>for lower in self[<NUM_LIT:1>:]:<EOL><INDENT>touching = new_strip[-<NUM_LIT:1>].touches(lower)<EOL>if strict:<EOL><INDENT>similar = new_strip[-<NUM_LIT:1>].components == lower.components<EOL><DEDENT>else:<EOL><INDENT>similar = new_strip[-<NUM_LIT:1>].primary == lower.primary<EOL><DEDENT>if touching and similar:<EOL><INDENT>new_strip[-<NUM_LIT:1>] = new_strip[-<NUM_LIT:1>].union(lower)<EOL><DEDENT>else:<EOL><INDENT>new_strip.append(lower.copy())<EOL><DEDENT><DEDENT>return Striplog(new_strip)<EOL>
Makes a new striplog in which matching neighbours (for which the
components are the same) are unioned. That is, they are replaced by
a new Interval with the same top as the uppermost and the same bottom
as the lowermost.

Args
    strict (bool): If True, then all of the components must match.
        If False, then only the primary must match.

Returns:
    Striplog. A new striplog.

TODO:
    Might need to be tweaked to deal with 'binary striplogs' if those
    aren't implemented with components.