Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamdanal committed May 4, 2024
1 parent 451a4bd commit f209fdb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This project is licensed under the MIT License.
<a href="https://github.com/geopandas/geopandas">GitHub</a>
</th>
<th>Complete</th>
<th>No</th>
<th>Partially</th>
</tr>
<tr>
<th>shapely</th>
Expand Down
4 changes: 2 additions & 2 deletions stubs/shapely-stubs/geometry/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ class BaseGeometry(Geometry):
def segmentize(self, max_segment_length: ArrayLikeSeq[float]) -> GeoArray: ...
def reverse(self) -> Self: ...

_GeoT = TypeVar("_GeoT", bound=Geometry, default=BaseGeometry, covariant=True)
_GeoT_co = TypeVar("_GeoT_co", bound=Geometry, default=BaseGeometry, covariant=True)

class BaseMultipartGeometry(BaseGeometry, Generic[_GeoT]):
class BaseMultipartGeometry(BaseGeometry, Generic[_GeoT_co]):
@property
def coords(self) -> NoReturn: ...
@property
Expand Down
6 changes: 3 additions & 3 deletions stubs/shapely-stubs/geometry/collection.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ from collections.abc import Collection
from typing_extensions import Self, overload

from shapely._typing import OptGeoArrayLike
from shapely.geometry.base import BaseMultipartGeometry, GeometrySequence, _GeoT
from shapely.geometry.base import BaseMultipartGeometry, GeometrySequence, _GeoT_co

class GeometryCollection(BaseMultipartGeometry[_GeoT]):
class GeometryCollection(BaseMultipartGeometry[_GeoT_co]):
# Overloads of __new__ are used because mypy is unable to narrow the typevar otherwise
@overload
def __new__(
self, geoms: BaseMultipartGeometry[_GeoT] | GeometrySequence[BaseMultipartGeometry[_GeoT]] | Collection[_GeoT]
self, geoms: BaseMultipartGeometry[_GeoT_co] | GeometrySequence[BaseMultipartGeometry[_GeoT_co]] | Collection[_GeoT_co]
) -> Self: ...
@overload
def __new__(self, geoms: OptGeoArrayLike = None) -> Self: ...
Expand Down
2 changes: 1 addition & 1 deletion tests/test_shapely/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_polygonize() -> None:
dtype=Polygon,
)
check(assert_type(poly[0], Polygon), Polygon)
check(assert_type(poly[:], GeometryCollection[Polygon]), GeometryCollection)
check(assert_type(poly[:], "GeometryCollection[Polygon]"), GeometryCollection)
check(assert_type(list(poly), list[Polygon]), list, dtype=Polygon)
check(assert_type(len(poly), int), int)

Expand Down

0 comments on commit f209fdb

Please sign in to comment.