-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changes from all commits
32f40b3
c3436ca
3a397d9
dc1c986
eda9cc8
8e0657c
99fd409
352b6e3
5de5e9f
f978235
b74e6a5
0328025
2f68c0a
0427a50
2ccbace
2061306
c6d3d75
8486f4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
codecov: | ||
notify: | ||
after_n_builds: 6 | ||
coverage: | ||
range: 50..95 | ||
round: nearest | ||
precision: 1 | ||
status: | ||
project: | ||
default: | ||
threshold: 2% | ||
patch: | ||
default: | ||
threshold: 2% | ||
target: 80% | ||
ignore: | ||
- "tests/*" | ||
comment: | ||
layout: "reach, diff, files" | ||
behavior: once | ||
after_n_builds: 6 | ||
require_changes: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import geopandas.testing | ||
import numpy | ||
import pandas | ||
import pytest | ||
import shapely | ||
|
||
line_collection = ( | ||
list[shapely.LineString] | ||
| tuple[shapely.LineString] | ||
| numpy.ndarray | ||
| pandas.Series | ||
| geopandas.GeoSeries | ||
) | ||
|
||
geometry_collection = ( | ||
list[shapely.GeometryCollection] | ||
| tuple[shapely.GeometryCollection] | ||
| numpy.ndarray | ||
| pandas.Series | ||
| geopandas.GeoSeries | ||
) | ||
|
||
|
||
def polygonize( | ||
collection: line_collection, as_geom: bool = True | ||
) -> shapely.Polygon | geopandas.GeoSeries: | ||
"""Testing helper -- Create polygon from collection of lines.""" | ||
if isinstance(collection, pandas.Series | geopandas.GeoSeries): | ||
_poly = geopandas.GeoSeries(collection).polygonize() | ||
if as_geom: | ||
return _poly.squeeze() | ||
else: | ||
return _poly | ||
else: | ||
return shapely.polygonize(collection).buffer(0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without
|
||
|
||
|
||
def is_geopandas(collection: geometry_collection) -> bool: | ||
return isinstance(collection, geopandas.GeoSeries | geopandas.GeoDataFrame) | ||
|
||
|
||
def geom_test( | ||
collection1: geometry_collection, | ||
collection2: geometry_collection, | ||
tolerance: float = 1e-1, | ||
) -> bool: | ||
"""Testing helper -- geometry verification.""" | ||
|
||
if not is_geopandas(collection1): | ||
collection1 = geopandas.GeoSeries(collection1) | ||
|
||
if not is_geopandas(collection2): | ||
collection2 = geopandas.GeoSeries(collection2) | ||
|
||
assert shapely.equals_exact( | ||
collection1.geometry.normalize(), | ||
collection2.geometry.normalize(), | ||
tolerance=tolerance, | ||
).all() | ||
|
||
|
||
def pytest_configure(config): # noqa: ARG001 | ||
"""PyTest session attributes, methods, etc.""" | ||
|
||
pytest.polygonize = polygonize | ||
pytest.geom_test = geom_test |
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.
I have requested access to configure
codecov.io
for theuscuni/sgeop
repo. Not sure if a notification was sent to you or not @martinfleis ?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.
approved
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.
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 forsimplification
either). Can you add me there and we'll see if that takes care of it?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.
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.
I think this is done. If not, please send me the link where I need to click something.