Closed kwinkunks closed 5 years ago
Seems like this could be handled by adding another __find_incongruities
alias with operator.eq
or operator.ge
as the op
(depending on desired behavior).
I know, and I'm not sure why I couldn't get it to work that way.
But I unearthed another problem, as the merging results in garbage 'blended' components.
At first glance I would think maybe it has something to do with the fact that when upper_iv.partially_overlaps(lower_iv) == False
, the lower
returned by upper_iv._explode(lower_iv)
is actually a copy of upper_iv
, rather than lower_iv
like it normally would be. Do you have a test example that shows what kind of garbage?
Also seems like "melting" two intervals should be a union
rather than a merge
. Maybe that's obvious, but just thought I'd mention it.
I found it easier to implement this in a new method on the Striplog
class. It's merge_neighbours()
and I think it does what I needed... but I haven't written tests for it yet. I think it can eventually be merged in one 'merge' function, but I didn't feel like refactoring merge_overlaps()
.
It's in 818e63b115503ee274c0ea9eebc2b49de6c95a9b and there's a demo in this new notebook.
Should be able to merge neighbours that touch but don't overlap.