Remove redundant cast to int
Delay the cast to int in contour.py

This is to allow checking againt nan below
Thangs @argriffing