diff --git a/src/h3/_h3shape.py b/src/h3/_h3shape.py index a42befef..78640e0f 100644 --- a/src/h3/_h3shape.py +++ b/src/h3/_h3shape.py @@ -1,9 +1,11 @@ from abc import ABCMeta, abstractmethod + class H3Shape(metaclass=ABCMeta): @property @abstractmethod - def __geo_interface__(self): ... + def __geo_interface__(self): + pass class H3Poly(H3Shape): @@ -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) @@ -233,6 +235,7 @@ def geo_to_h3shape(geo): return mpoly + def h3shape_to_geo(h3shape): """ Translate from H3Shape to a __geo_interface__ dict. diff --git a/src/h3/api/basic_int/__init__.py b/src/h3/api/basic_int/__init__.py index 804252ca..21e848a7 100644 --- a/src/h3/api/basic_int/__init__.py +++ b/src/h3/api/basic_int/__init__.py @@ -1,2 +1,2 @@ from ._public_api import * # noqa -from ..._h3shape import H3MultiPoly, H3Poly, H3Shape +from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa diff --git a/src/h3/api/basic_str/__init__.py b/src/h3/api/basic_str/__init__.py index 804252ca..21e848a7 100644 --- a/src/h3/api/basic_str/__init__.py +++ b/src/h3/api/basic_str/__init__.py @@ -1,2 +1,2 @@ from ._public_api import * # noqa -from ..._h3shape import H3MultiPoly, H3Poly, H3Shape +from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa diff --git a/src/h3/api/memview_int/__init__.py b/src/h3/api/memview_int/__init__.py index 804252ca..21e848a7 100644 --- a/src/h3/api/memview_int/__init__.py +++ b/src/h3/api/memview_int/__init__.py @@ -1,2 +1,2 @@ from ._public_api import * # noqa -from ..._h3shape import H3MultiPoly, H3Poly, H3Shape +from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa diff --git a/src/h3/api/numpy_int/__init__.py b/src/h3/api/numpy_int/__init__.py index 804252ca..21e848a7 100644 --- a/src/h3/api/numpy_int/__init__.py +++ b/src/h3/api/numpy_int/__init__.py @@ -1,2 +1,2 @@ from ._public_api import * # noqa -from ..._h3shape import H3MultiPoly, H3Poly, H3Shape +from ..._h3shape import H3MultiPoly, H3Poly, H3Shape # noqa diff --git a/tests/polyfill/test_h3.py b/tests/polyfill/test_h3.py index 6ed1c571..6a405c38 100644 --- a/tests/polyfill/test_h3.py +++ b/tests/polyfill/test_h3.py @@ -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)]])