Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port GerryChain adjacency calcs to Shapely 2.0 #405

Merged
merged 8 commits into from Feb 8, 2023
Merged

Conversation

InnovativeInventor
Copy link
Member

@InnovativeInventor InnovativeInventor commented Oct 29, 2022

Shapely 2.0 will introduce breaking changes for GerryChain. In particular, our adjacency calculation code will break (and we won't be able to make new dual graphs). Although Shapely 2.0 hasn't stabilized yet, it appears that recent updates in our dependencies (i.e. geopandas) has caused some issues to show up prior to Shapely 2.0 being offically stable.

Relevant issues:

#369 was originally a stop-gap fix for this PR. We should be able to remove the import warning in gerrychain/__init__.py.

@InnovativeInventor
Copy link
Member Author

Note: tests are failing due to Shapely 2.0 not being stable yet. Do not merge this PR. We should also add some dependency constraints to ensure that if GerryChain gets updated in a user's install, Shapely will get upgraded as well.

To be clear: this is a breaking change. This PR aims to deprecate Shapely < 2.0.

@InnovativeInventor
Copy link
Member Author

We should port maup to use GerryChain's adjacency calculations (or vice-versa) so maup does not suffer from the same impending deprecation issue.

@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Merging #405 (7453d80) into main (3179ac1) will decrease coverage by 0.11%.
The diff coverage is 75.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #405      +/-   ##
==========================================
- Coverage   89.10%   89.00%   -0.11%     
==========================================
  Files          39       39              
  Lines        1772     1774       +2     
==========================================
  Hits         1579     1579              
- Misses        193      195       +2     
Impacted Files Coverage Δ
gerrychain/graph/graph.py 91.12% <66.66%> (-1.00%) ⬇️
gerrychain/graph/adjacency.py 88.88% <100.00%> (-0.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3179ac1...7453d80. Read the comment docs.

@pjrule pjrule merged commit a35f7cc into main Feb 8, 2023
@pjrule pjrule deleted the shapely-2.0-port branch February 8, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shapely deprecation warning Use maup for adjacencies?
2 participants