REGR: ensure oriented_envelope (GEOS<3.12 code path) accepts array-like with ufunc protocol#1939
Merged
jorisvandenbossche merged 2 commits intoshapely:mainfrom Feb 12, 2024
Conversation
…ke with ufunc protocol
Member
Author
|
cc @martinfleis |
Pull Request Test Coverage Report for Build 7873176998Details
💛 - Coveralls |
brendan-ward
approved these changes
Nov 29, 2023
Collaborator
brendan-ward
left a comment
There was a problem hiding this comment.
Thanks @jorisvandenbossche !
jorisvandenbossche
added a commit
to jorisvandenbossche/shapely
that referenced
this pull request
Feb 12, 2024
…ke with ufunc protocol (shapely#1939)
jorisvandenbossche
added a commit
that referenced
this pull request
Feb 16, 2024
…ke with ufunc protocol (#1939)
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 #1929
In the end I thought to use
np.frompyfuncand remove the manual iteration, instead of just fixing that single check for when to use the iteration code path. This ensures that it will work consistently with numpy in what it accepts (the kinds of array likes), and also that it will return the array like objects if those implement the numpy protocols (eg in shapely 2.0.1, calling this function on a geopandas.GeoSeries will also return a GeoSeries)