Repository navigation
Make spatial matching compatible with PuLP 4 - #963
Open
MahnoorAhmed999 wants to merge 2 commits into
Open
MahnoorAhmed999 wants to merge 2 commits into
MahnoorAhmed999 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #963 +/- ##
=====================================
Coverage 86.0% 86.0%
=====================================
Files 151 151
Lines 16645 16677 +32
=====================================
+ Hits 14318 14349 +31
- Misses 2327 2328 +1
🚀 New features to boost your workflow:
|
3 of 4 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #944
The spatial matching in
Graph.build_spatial_matches/_spatial_matchingdid not work with PuLP 4. This makes it work with PuLP 4 while staying backwards compatible with PuLP 3.Changes in
libpysal/graph/_matching.pyLpProblem.add_variable_dictswhen available (PuLP 4 removedLpVariable.dicts), falling back toLpVariable.dictson PuLP 3.>=/==/<=comparisons instead ofLpConstraint(..., sense=..., rhs=...), which works on both versions.solve()returns a solve report in PuLP 4 instead of an integer, so the status is read from either form, and the warning usesstatus_strorLpStatus.solver=Noneand PuLP has no default, the first available solver is used, with a clearImportErrorif none is installed.Other changes
pulp<4pin removed from theplusextra, withhighspyadded so PuLP 4 has a solver. The latest and dev CI environments use PuLP 4 withhighspy, while312-oldestkeepspulp<4so PuLP 3 stays tested.solverupdated for PuLP 4.test_returns_mipno longer checksLpProblem.sol_status, which PuLP 4 removed; the infeasible case is still checked through the warning.test_default_solver(no solver passed) andtest_infeasible_without_solution.Testing
libpysal/graph/tests/test_matching.pypasses with PuLP 4.3.1 (HiGHS) and PuLP 3.3.2 (CBC).test_storeswas not run locally because it needs to download the GeoDa liquor stores dataset.libpysal/graph/testsshows no new failures.