pysal / pointpats

Planar Point Pattern Analysis in PySAL
https://pysal.org/pointpats/
BSD 3-Clause "New" or "Revised" License
83 stars 26 forks source link

update centrography test for dep induced precision breakage #69

Closed sjsrey closed 1 year ago

sjsrey commented 3 years ago

Something changed in the dependency stack as the ordering and precision on the return was causing failures on travis for a a bit now.

ljwolf commented 3 years ago

Thanks, must've missed the test failures. This is happening because the order of the rectangle points returned from openCV has changed. They're now counter-clockwise, rather than clockwise.

My original variable names (I think) become a bit misleading, since the points aren't really the max/min x/y anymore.

So, I've just updated the order in the point array & swapped to allclose. Since opencv only works with float32, we'll need higher absolute precision in the allclose. I've updated that to the libpysal.common.ATOL * 100.

ljwolf commented 3 years ago

Odd... on my platform, I'm getting different results even with the same version of opencv? I think this can be addressed by testing the numpy.roll of the bounding box, since the right answer sometimes appears to be just one row offset.

ljwolf commented 3 years ago

Seems like there was an issue with the build... no failure, just an error from a timeout. I can't trigger a rebuild, as I don't think I'm a maintainer?

ljwolf commented 3 years ago

With the minimum rotated rectangle in GEOS being exposed soon by PyGEOS, we should move this functionality to use pygeos in a future release.

codecov[bot] commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@5e2922f). Click here to learn what that means. The diff coverage is n/a.

@@            Coverage Diff            @@
##             master      #69   +/-   ##
=========================================
  Coverage          ?   63.15%           
=========================================
  Files             ?       19           
  Lines             ?     2266           
  Branches          ?        0           
=========================================
  Hits              ?     1431           
  Misses            ?      835           
  Partials          ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.