Skip to content

Remove cython code: remove the speedups module + refactor the vectorized module#1036

Merged
jorisvandenbossche merged 4 commits intoshapely:shapely-2.0from
jorisvandenbossche:refactor-cleanup-speedups
Nov 27, 2020
Merged

Remove cython code: remove the speedups module + refactor the vectorized module#1036
jorisvandenbossche merged 4 commits intoshapely:shapely-2.0from
jorisvandenbossche:refactor-cleanup-speedups

Conversation

@jorisvandenbossche
Copy link
Copy Markdown
Member

This removes all cython code that is currently present in Shapely (although we are adding cython back as a dependency in PyGEOS and thus later Shapely, but it will be different cython code):

  • The shapely.speedups module was no longer used after the refactorings that are already merged. So I removed the code, but kept a compatibility shim for Shapely 2.0, so we can start depecating for people doing shapely.speedups.enable()/disable().
    (we can't yet do that in Shapely 1.8, because for 1.8 it has an essential meaning that cannot yet be replaced, I think?)

  • The shapely.vectorized module is rewritten in a few lines of pygeos code to keep compatibility with the exact function signatures. We should still discuss if we want to keep those long term or want to replace with the new ufuncs, but that is again something that can be done later (we can keep them for an initial Shapely 2.0 release, potentially with deprecation warnings, since there is not yet an alternative in Shapely 1.8)

@@ -2803,33 +2803,6 @@ used in many applications and you can expect that all operations are highly
optimized. The creation of new geometries with many coordinates, however,
involves some overhead that might slow down your code.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This section above here will need to be rewritten a bit once the pygeos ufuncs are added to Shapely

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 24, 2020

Coverage Status

Coverage increased (+0.2%) to 77.921% when pulling c4ff21a on jorisvandenbossche:refactor-cleanup-speedups into e0d3c53 on Toblerity:shapely-2.0.

# if testing without numpy explicitly remove it
- if [ "$NUMPY" == "0" ]; then pip uninstall --yes numpy; fi
# convert SPEEDUPS to --with-speedups/--without-speedups
- if [ "$SPEEDUPS" == "1" ]; then SPEEDUPS_FLAG=--with-speedups; else SPEEDUPS_FLAG=--without-speedups; fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might as well further simplify this configuration to remove all logic handling NUMPY and SPEEDUPS

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, certainly. But since we are probably going to refactor this completely (eg moving to github actions), similarly as we did in pygeos, I would maybe leave further clean-up for that change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure, that can wait until then. And yes, I was thinking that we may want to refactor the CI setup based on the recent pygeos work.

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

See #1020 (comment) for failure, will deal with that separately.

@jorisvandenbossche jorisvandenbossche merged commit de762e5 into shapely:shapely-2.0 Nov 27, 2020
@jorisvandenbossche jorisvandenbossche deleted the refactor-cleanup-speedups branch November 27, 2020 10:41
jorisvandenbossche added a commit to jorisvandenbossche/shapely that referenced this pull request Apr 5, 2021
jorisvandenbossche added a commit to jorisvandenbossche/shapely that referenced this pull request Apr 5, 2021
jorisvandenbossche added a commit to jorisvandenbossche/shapely that referenced this pull request May 27, 2021
jorisvandenbossche added a commit to jorisvandenbossche/shapely that referenced this pull request May 27, 2021
jorisvandenbossche added a commit to jorisvandenbossche/shapely that referenced this pull request Aug 20, 2021
jorisvandenbossche added a commit to jorisvandenbossche/shapely that referenced this pull request Sep 30, 2021
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