Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfriend committed Nov 8, 2023
1 parent f320c13 commit 56c35d8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/h3/_h3shape.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from abc import ABCMeta, abstractmethod


class H3Shape(metaclass=ABCMeta):
@property
@abstractmethod
def __geo_interface__(self): ...
def __geo_interface__(self):
pass

Check warning on line 8 in src/h3/_h3shape.py

View check run for this annotation

Codecov / codecov/patch

src/h3/_h3shape.py#L8

Added line #L8 was not covered by tests


class H3Poly(H3Shape):
Expand Down Expand Up @@ -74,7 +76,7 @@ def __init__(self, *polys):

for p in self.polys:
if not isinstance(p, H3Poly):
raise ValueError('H3MultiPoly requires each input to be an H3Poly object, instead got: ' + str(p))
raise ValueError('H3MultiPoly requires each input to be an H3Poly object, instead got: ' + str(p)) # noqa

def __repr__(self):
return 'H3MultiPoly' + str(self.polys)
Expand Down Expand Up @@ -233,6 +235,7 @@ def geo_to_h3shape(geo):

return mpoly


def h3shape_to_geo(h3shape):
"""
Translate from H3Shape to a __geo_interface__ dict.
Expand Down
2 changes: 1 addition & 1 deletion src/h3/api/basic_int/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ._public_api import * # noqa
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa
2 changes: 1 addition & 1 deletion src/h3/api/basic_str/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ._public_api import * # noqa
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa
2 changes: 1 addition & 1 deletion src/h3/api/memview_int/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ._public_api import * # noqa
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa
2 changes: 1 addition & 1 deletion src/h3/api/numpy_int/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ._public_api import * # noqa
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape
from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa
3 changes: 1 addition & 2 deletions tests/polyfill/test_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,5 @@ def test_multipoly_checks():
with pytest.raises(ValueError):
h3.H3MultiPoly(1)


with pytest.raises(ValueError):
h3.H3MultiPoly([[(1,2), (3,4)]])
h3.H3MultiPoly([[(1, 2), (3, 4)]])

0 comments on commit 56c35d8

Please sign in to comment.