-
Notifications
You must be signed in to change notification settings - Fork 560
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
Refactor Geometry classes to subclass the C extension type #983
Merged
jorisvandenbossche
merged 27 commits into
shapely:shapely-2.0
from
jorisvandenbossche:geometry-subclasses
Nov 4, 2020
Merged
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
2a2cb7c
WIP: use pygeos as base for Geometry classes
jorisvandenbossche 572229e
updates
jorisvandenbossche 7df3d80
fix pickling / unary_union
jorisvandenbossche 04cfb6a
fix CoordinateSequence
jorisvandenbossche 460b06f
fixup or xfail remaining failing tests
jorisvandenbossche 9eaeb16
clean-up some tests
jorisvandenbossche 0631343
add pygeos to travis
jorisvandenbossche 55150c1
wrong GEOS is used to build pygeos
jorisvandenbossche 5fdfe3a
Apply suggestions from code review
jorisvandenbossche 3a81476
try with GEOS_CONFIG env variable
jorisvandenbossche a28f6da
clean-up - remove unused attributes
jorisvandenbossche 8c847f1
fix Point.z for older GEOS
jorisvandenbossche afaa0af
debug interpolate failure
jorisvandenbossche e3cde59
clean-up travis
jorisvandenbossche 984d556
spelling normalize->normalized
jorisvandenbossche f738a8b
cache CoordinateSequence
jorisvandenbossche 820a5b3
use GEOS is_ccw when available
jorisvandenbossche fbb982e
remove Point.bounds override
jorisvandenbossche a913fe9
Install pygeos in appveyor.yml
jorisvandenbossche 8fb974c
set env variables for pygeos
jorisvandenbossche 86ad103
skip failing singularity test
jorisvandenbossche aca39fd
clean-up print
jorisvandenbossche 646d554
skip test on Appveyor
jorisvandenbossche 3024adc
fix WKT dimensionality test
jorisvandenbossche 41fe614
support big_endian keyword
jorisvandenbossche ded9d98
skip speedups import test on Appveyor
jorisvandenbossche e83d073
clean-up
jorisvandenbossche File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly to do with this
CoordinateSequence
class is something still to be discussed, and I opened #984 for thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been reading up on #984 and I tend to go with this implementation for this PR (making
self._coords
a ndarray directly)However I think that sticking a full duplicate of
coords
to the object by default is a bit too much. Also_coords
won't be initialized properly in all construction paths.Within this approach (I actually like the lazy CoordinateSequency object approach better) I think it is best to use a pattern like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this CoordinateSequence is not constructed by default when creating a geometry object. It will only be created once a user accesses the
geom.coords
attribute.Now, with the current code, each time the user does
geom.coords
, it will create a new CoordinateSequence object containing a new array, so making this "cached" is certainly a good idea (as well as making the array not writable)