pysal / region

A library for Spatially-Explicit Regionalization
BSD 3-Clause "New" or "Revised" License
14 stars 16 forks source link

Reopen PR #8 #9

Closed weikang9009 closed 6 years ago

weikang9009 commented 6 years ago

Reopen #8

weikang9009 commented 6 years ago

Let me know if there is still an issue @ljwolf

weikang9009 commented 6 years ago

Not sure why some tests in test_heu.py fail occasionally.

ljwolf commented 6 years ago

Hmm... it's not all solvers, only the geodataframe and networkx ones...

yogabonito commented 6 years ago

I guess it's because the heuristic algorithms can produce suboptimal solutions. However, I didn't expect it to happen that often. One solution to prevent failing tests would be to set the random seed, i.e. to replace all occurrences of cluster_object = MaxPRegionsHeu() with cluster_object = MaxPRegionsHeu(random_state=SOME_INTEGER_WHERE_THE_TESTS_PASS) in test_heu.py. Do you consider going this path OK?

ljwolf commented 6 years ago

Yeah, that'd be appropriate: if the algorithm is nondeterminstic, it needs to use a seed.

On Wed, May 9, 2018 at 10:20 AM yogabonito notifications@github.com wrote:

I guess it's because the heuristic algorithms can produce suboptimal solutions. However, I didn't expect it to happen that often. One solution to prevent failing tests would be to set the random seed, i.e. to replace all occurrences of cluster_object = MaxPRegionsHeu() with cluster_object = MaxPRegionsHeu(random_state=SOME_INTEGER_WHERE_THE_TESTS_PASS) in test_heu.py. Do you consider going this path OK?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pysal/region/pull/9#issuecomment-387677932, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJY84gXWzOA5JOQNc11UXIFhZ6v4uNXks5twrTCgaJpZM4T3dQ3 .

--

Levi John Wolf Lecturer in Quantitative Human Geography | University of Bristol Fellow | Center for Spatial Data Science, University of Chicago Associate Member | Center for Multilevel Modeling, University of Bristol Interim Director | Q-Step Program, University of Bristol ljwolf.org

ljwolf commented 6 years ago

Man, still says "cannot be rebased due to conflicts." I'll see if I can figure this out.