rgmyr/corebreakout

Undefined function in utils.py

Closed this issue · 1 comments

Hello,

The make_endpts_data.ipynb notebook calls corebreakout.utils.v_overlapping but it doesn't exist in utils.py
Here is the relevant traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-18-6516187f6779> in <module>
      1 r1, r2 = regions[0], regions[2]
      2 
----> 3 utils.v_overlapping(r1, r2)

AttributeError: module 'corebreakout.utils' has no attribute 'v_overlapping'

rgmyr commented

Fixed in 16aab9a.

v_overlapping was a function from an earlier version of utils.py (apparently it was deleted even before I created an orphan branch of this repo). I forgot that I had a used it there, although I don't consider that a "test" notebook. So, instead of adding it back to utils, I just defined it in that cell of the notebook:

def v_overlapping(r1, r2):
    """Check if bboxes have vertical overlap."""
    _, r1_min, _, r1_max = r1.bbox
    _, r2_min, _, r2_max = r2.bbox
    return (r1_min <= r2_max) and (r2_min <= r1_max)