silburt/DeepMoon

`pytest test_get_unique_craters.py` returns no detections in (my environment for) Python 3

cczhu opened this issue · 2 comments

cczhu commented

I ran pytest test_get_unique_craters.py in my Python 2 and Python 3 virtualenvs, and in the Python 3 one it template_match_t2c returned N_match == 0 under the test_extract test. Not obvious why this is happening on a quick inspection of the function.

Yes, I was investigating this yesterday and figured out the problem during my own testing. Turns out in python 3:

zip(*index_r)

returns an object and not a list by default. So Changing:
coords_r = np.asarray(zip(*index_r))
to
coords_r = np.asarray(list(zip(*index_r)))
fixed the problem for me. @cczhu could you pull from master (I just merged fixed changes) and try again and confirm that you get good results now?

cczhu commented

@silburt Works now, thanks for the update!