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

first round geometry.voronoi_skeleton() tests #27

Merged
merged 18 commits into from
Oct 15, 2024
Merged

Conversation

jGaboardi
Copy link
Collaborator

@jGaboardi jGaboardi self-assigned this Oct 6, 2024
@jGaboardi jGaboardi mentioned this pull request Oct 6, 2024
5 tasks
snap_to : None | gpd.GeoSeries = None
Series of geometries that shall be connected to the skeleton.
max_segment_length: int = 1
...
distance : float
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#25

Copy link
Contributor

Choose a reason for hiding this comment

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

Additional vertices will be added so that all line segments are no longer than this value. Must be greater than 0.

@jGaboardi
Copy link
Collaborator Author

jGaboardi commented Oct 6, 2024

@martinfleis Do we think I should:

  • spend more time adapting tests for minimum geopandas
  • skip some minimum geopandas tests
  • bump minimum geopandas version

@martinfleis
Copy link
Contributor

I have no clue where the issue comes from but I'd bump minimum versions to whatever works. We don't need to service legacy code here.

@@ -1,6 +1,6 @@
# `sgeop`: Street Geometry Processing Toolkit

[![Continuous Integration](https://github.com/uscuni/sgeop/actions/workflows/testing.yml/badge.svg)](https://github.com/uscuni/sgeop/actions/workflows/testing.yml)
[![Continuous Integration](https://github.com/uscuni/sgeop/actions/workflows/testing.yml/badge.svg)](https://github.com/uscuni/sgeop/actions/workflows/testing.yml) [![codecov](https://codecov.io/gh/uscuni/sgeop/branch/main/graph/badge.svg?token=VNn0WR5JWT)](https://codecov.io/gh/uscuni/sgeop)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have requested access to configure codecov.io for the uscuni/sgeop repo. Not sure if a notification was sent to you or not @martinfleis ?

Copy link
Contributor

Choose a reason for hiding this comment

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

approved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Still nothing showing up. 99% sure it's because I am not listed as a member of the uscuni organization (and that's why we couldn't work it out for simplification either). Can you add me there and we'll see if that takes care of it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2024-10-06 at 5 01 28 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is done. If not, please send me the link where I need to click something.

@jGaboardi jGaboardi requested a review from martinfleis October 6, 2024 17:56
@jGaboardi jGaboardi removed the request for review from martinfleis October 7, 2024 01:46
@jGaboardi jGaboardi marked this pull request as draft October 7, 2024 01:47
@jGaboardi
Copy link
Collaborator Author

Something in this PR leads to the following failure:

 1038 # skeletonize
-> 1039 skel, _ = voronoi_skeleton(
   1040     skeletonization_input,
   1041     cluster_geom,
   1042     snap_to=False,
   1043     max_segment_length=max_segment_length,
   1044     limit_distance=1e-4,
   1045     consolidation_tolerance=consolidation_tolerance,
   1046 )
   1048 # if we used only segments, we need to remove dangles
   1049 if len(connection) == 1:

Need to be running a full sgeop.simplify() call in testing (even if not explicitly testing anything yet), just to make sure it passes.

@jGaboardi jGaboardi marked this pull request as ready for review October 11, 2024 18:50
@jGaboardi jGaboardi marked this pull request as draft October 11, 2024 18:50
@jGaboardi jGaboardi marked this pull request as ready for review October 12, 2024 18:39
@jGaboardi
Copy link
Collaborator Author

OK, @martinfleis – this is now ready for review.

@jGaboardi jGaboardi requested a review from martinfleis October 12, 2024 18:39
@jGaboardi jGaboardi changed the title first round geometry.voronoi_skeleton() tests first round geometry.voronoi_skeleton() tests Oct 14, 2024
@@ -1,6 +1,6 @@
# `sgeop`: Street Geometry Processing Toolkit

[![Continuous Integration](https://github.com/uscuni/sgeop/actions/workflows/testing.yml/badge.svg)](https://github.com/uscuni/sgeop/actions/workflows/testing.yml)
[![Continuous Integration](https://github.com/uscuni/sgeop/actions/workflows/testing.yml/badge.svg)](https://github.com/uscuni/sgeop/actions/workflows/testing.yml) [![codecov](https://codecov.io/gh/uscuni/sgeop/branch/main/graph/badge.svg?token=VNn0WR5JWT)](https://codecov.io/gh/uscuni/sgeop)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is done. If not, please send me the link where I need to click something.

snap_to : None | gpd.GeoSeries = None
Series of geometries that shall be connected to the skeleton.
max_segment_length: int = 1
...
distance : float
Copy link
Contributor

Choose a reason for hiding this comment

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

Additional vertices will be added so that all line segments are no longer than this value. Must be greater than 0.

sgeop/geometry.py Show resolved Hide resolved
sgeop/tests/conftest.py Outdated Show resolved Hide resolved
else:
return _poly
else:
return shapely.polygonize(collection).buffer(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

shapely.make_valid() is not fixing the problem locally (perhaps solution in current dev) -- still need .buffer(0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without .buffer(0) still seeing:

FAILED sgeop/tests/test_geometry.py::TestVoronoiSkeleton::test_square[array-True-0.1] - AttributeError: 'GeometryCollection' object has no attribute 'exterior'
FAILED sgeop/tests/test_geometry.py::TestVoronoiSkeleton::test_square_snap_to[list-True-0.001] - AttributeError: 'GeometryCollection' object has no attribute 'exterior'
FAILED sgeop/tests/test_geometry.py::TestVoronoiSkeleton::test_square[list-True-0.001] - AttributeError: 'GeometryCollection' object has no attribute 'exterior'
FAILED sgeop/tests/test_geometry.py::TestVoronoiSkeleton::test_square_snap_to[array-True-0.1] - AttributeError: 'GeometryCollection' object has no attribute 'exterior'

Copy link
Contributor

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

Alright, let's give this a go.

@jGaboardi jGaboardi merged commit abbd153 into main Oct 15, 2024
8 checks passed
@jGaboardi jGaboardi deleted the GH20_geometry_tests branch October 15, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants