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

Update dependency shapely to v2 #1642

Merged
merged 3 commits into from
Jan 9, 2023
Merged

Update dependency shapely to v2 #1642

merged 3 commits into from
Jan 9, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 27, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
shapely ==1.8.5.post1 -> ==2.0.0 age adoption passing confidence

Release Notes

shapely/shapely

v2.0.0

Compare Source

Shapely version 2.0.0 is a major release featuring a complete refactor of the
internals and new vectorized (element-wise) array operations providing
considerable performance improvements.

For a full changelog, see
https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-0-0

Relevant changes in behaviour compared to 2.0rc3:

  • Added temporary support for unpickling shapely<2.0 geometries.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@jwkaltz jwkaltz self-requested a review December 28, 2022 09:05
@jwkaltz jwkaltz self-assigned this Dec 28, 2022
@jwkaltz
Copy link
Member

jwkaltz commented Dec 28, 2022

Current strategy:
First fix the Shapely deprecation warnings on current master

Then reevaluate the upgrade to Shapely 2.

@renovate renovate bot force-pushed the renovate/shapely-2.x branch 2 times, most recently from cc5bc9d to e81fb34 Compare January 5, 2023 08:03
@renovate renovate bot force-pushed the renovate/shapely-2.x branch from e81fb34 to 619d2aa Compare January 5, 2023 09:09
@renovate
Copy link
Contributor Author

renovate bot commented Jan 6, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@jwkaltz jwkaltz removed their request for review January 6, 2023 06:46
@jwkaltz
Copy link
Member

jwkaltz commented Jan 6, 2023

It seems Shapely 2.0 raises a different exception type than Shapely 1.8:
shapely.errors.GEOSException: TopologyException: Input geom 1 is invalid: Self-intersection at 0.5 0.5

The type of exception in our test case is shapely.errors.GEOSException,
whereas the same case in Shapely 1.8 results in a shapely.errors.TopologicalError

The behavior seems equivalent, so I adapted the test case.

Further reviews appreciated.

@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

Merging #1642 (e19f912) into master (8f8b522) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1642   +/-   ##
=======================================
  Coverage   77.50%   77.50%           
=======================================
  Files         127      127           
  Lines        5209     5209           
=======================================
  Hits         4037     4037           
  Misses       1172     1172           
Flag Coverage Δ
unittests 77.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jwkaltz jwkaltz requested a review from mki-c2c January 6, 2023 06:51
@jwkaltz
Copy link
Member

jwkaltz commented Jan 6, 2023

@mki-c2c can you please see if the test case adaptation makes sense,
in light of what you summarized in #1111?

See also my previous comment.

Copy link
Contributor

@mki-c2c mki-c2c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks.
I did the following review actions:

Everything tells me the current use of shapely (and the caught exception) is fine and I could not find any deprecations.
We should continue checking for deprecation warnings in the test outputs.

@jwkaltz
Copy link
Member

jwkaltz commented Jan 6, 2023

@voisardf @michmuel do you also want to review this upgrade?
To us it seems OK.
Tests are OK, extract generation with the dev data also.

@jwkaltz jwkaltz requested review from michmuel and voisardf January 6, 2023 13:19
@michmuel
Copy link
Collaborator

michmuel commented Jan 9, 2023

@jwkaltz I will test it in our environment.

Copy link
Collaborator

@michmuel michmuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some tests in our environment and did not encounter any differences to version 1.8. I remember (or think to) that there was a discussion about shapely at the beginning of working on pyramid oereb v2. Was this related to shapely and python version 3.7 or was it related to the handling of not valid geometries in different versions of shapely?

@jwkaltz
Copy link
Member

jwkaltz commented Jan 9, 2023

I made some tests in our environment and did not encounter any differences to version 1.8. I remember (or think to) that there was a discussion about shapely at the beginning of working on pyramid oereb v2. Was this related to shapely and python version 3.7 or was it related to the handling of not valid geometries in different versions of shapely?

Yes, there were some differences in behaviour for older versions, summarized here: #1111
But regarding invalid geometries, there seems to be no differences in behavior between 1.8.5 and 2.0.0.

Copy link
Collaborator

@michmuel michmuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I have no objections. Thanks.

@jwkaltz jwkaltz merged commit 2cc9b41 into master Jan 9, 2023
@jwkaltz jwkaltz deleted the renovate/shapely-2.x branch January 9, 2023 14:47
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.

3 participants