mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-11 12:10:59 +08:00
CI: update black (#2404)
This commit is contained in:
+10
-10
@@ -1,12 +1,12 @@
|
||||
files: 'geopandas\/'
|
||||
repos:
|
||||
- repo: https://github.com/python/black
|
||||
rev: 20.8b1
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.8.3
|
||||
hooks:
|
||||
- id: flake8
|
||||
language: python_venv
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.8.3
|
||||
hooks:
|
||||
- id: flake8
|
||||
language: python_venv
|
||||
|
||||
@@ -149,7 +149,6 @@ if shapely_warning is not None and not SHAPELY_GE_20:
|
||||
)
|
||||
yield
|
||||
|
||||
|
||||
elif (Version(np.__version__) >= Version("1.21")) and not SHAPELY_GE_20:
|
||||
|
||||
@contextlib.contextmanager
|
||||
@@ -162,7 +161,6 @@ elif (Version(np.__version__) >= Version("1.21")) and not SHAPELY_GE_20:
|
||||
)
|
||||
yield
|
||||
|
||||
|
||||
else:
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
||||
@@ -50,7 +50,7 @@ class Options(object):
|
||||
cls = self.__class__.__name__
|
||||
description = ""
|
||||
for key, option in self._options.items():
|
||||
descr = u"{key}: {cur!r} [default: {default!r}]\n".format(
|
||||
descr = "{key}: {cur!r} [default: {default!r}]\n".format(
|
||||
key=key, cur=self._config[key], default=option.default_value
|
||||
)
|
||||
description += descr
|
||||
@@ -58,7 +58,7 @@ class Options(object):
|
||||
if option.doc:
|
||||
doc_text = "\n".join(textwrap.wrap(option.doc, width=70))
|
||||
else:
|
||||
doc_text = u"No description available."
|
||||
doc_text = "No description available."
|
||||
doc_text = textwrap.indent(doc_text, prefix=" ")
|
||||
description += doc_text + "\n"
|
||||
space = "\n "
|
||||
|
||||
+1
-1
@@ -272,7 +272,7 @@ def _convert_linearring_to_linestring(gdf, geom_name):
|
||||
|
||||
|
||||
def _convert_to_ewkb(gdf, geom_name, srid):
|
||||
"""Convert geometries to ewkb. """
|
||||
"""Convert geometries to ewkb."""
|
||||
if compat.USE_PYGEOS:
|
||||
from pygeos import set_srid, to_wkb
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ from shapely.geometry import Point
|
||||
|
||||
|
||||
def create_pickle_data():
|
||||
""" create the pickle data """
|
||||
"""create the pickle data"""
|
||||
|
||||
# custom geometry column name
|
||||
gdf_the_geom = geopandas.GeoDataFrame(
|
||||
|
||||
@@ -490,7 +490,7 @@ class TestGeomMethods:
|
||||
)
|
||||
assert_array_dtype_equal(expected, self.na_none.distance(self.p0))
|
||||
|
||||
expected = Series(np.array([np.sqrt(4 ** 2 + 4 ** 2), np.nan]), self.g6.index)
|
||||
expected = Series(np.array([np.sqrt(4**2 + 4**2), np.nan]), self.g6.index)
|
||||
assert_array_dtype_equal(expected, self.g6.distance(self.na_none))
|
||||
|
||||
expected = Series(np.array([np.nan, 0, 0, 0, 0, 0, np.nan, np.nan]), range(8))
|
||||
|
||||
@@ -1090,9 +1090,9 @@ class TestMapclassifyPlotting:
|
||||
)
|
||||
labels = [t.get_text() for t in ax.get_legend().get_texts()]
|
||||
expected = [
|
||||
u" 140.00, 5217064.00",
|
||||
u" 5217064.00, 19532732.33",
|
||||
u" 19532732.33, 1379302771.00",
|
||||
" 140.00, 5217064.00",
|
||||
" 5217064.00, 19532732.33",
|
||||
" 19532732.33, 1379302771.00",
|
||||
]
|
||||
assert labels == expected
|
||||
|
||||
@@ -1125,7 +1125,7 @@ class TestMapclassifyPlotting:
|
||||
column="NEGATIVES", scheme="FISHER_JENKS", k=3, cmap="OrRd", legend=True
|
||||
)
|
||||
labels = [t.get_text() for t in ax.get_legend().get_texts()]
|
||||
expected = [u"-10.00, -3.41", u" -3.41, 3.30", u" 3.30, 10.00"]
|
||||
expected = ["-10.00, -3.41", " -3.41, 3.30", " 3.30, 10.00"]
|
||||
assert labels == expected
|
||||
|
||||
def test_fmt(self):
|
||||
@@ -1138,7 +1138,7 @@ class TestMapclassifyPlotting:
|
||||
legend_kwds={"fmt": "{:.0f}"},
|
||||
)
|
||||
labels = [t.get_text() for t in ax.get_legend().get_texts()]
|
||||
expected = [u"-10, -3", u" -3, 3", u" 3, 10"]
|
||||
expected = ["-10, -3", " -3, 3", " 3, 10"]
|
||||
assert labels == expected
|
||||
|
||||
def test_interval(self):
|
||||
@@ -1151,7 +1151,7 @@ class TestMapclassifyPlotting:
|
||||
legend_kwds={"interval": True},
|
||||
)
|
||||
labels = [t.get_text() for t in ax.get_legend().get_texts()]
|
||||
expected = [u"[-10.00, -3.41]", u"( -3.41, 3.30]", u"( 3.30, 10.00]"]
|
||||
expected = ["[-10.00, -3.41]", "( -3.41, 3.30]", "( 3.30, 10.00]"]
|
||||
assert labels == expected
|
||||
|
||||
@pytest.mark.parametrize("scheme", ["FISHER_JENKS", "FISHERJENKS"])
|
||||
|
||||
@@ -767,14 +767,14 @@ class TestNearest:
|
||||
[Point(1, 1), Point(0.25, 1)],
|
||||
[0, 1],
|
||||
[1, 0],
|
||||
[math.sqrt(0.25 ** 2 + 1), 0],
|
||||
[math.sqrt(0.25**2 + 1), 0],
|
||||
),
|
||||
(
|
||||
[Point(0, 0), Point(1, 1)],
|
||||
[Point(-10, -10), Point(100, 100)],
|
||||
[0, 1],
|
||||
[0, 0],
|
||||
[math.sqrt(10 ** 2 + 10 ** 2), math.sqrt(11 ** 2 + 11 ** 2)],
|
||||
[math.sqrt(10**2 + 10**2), math.sqrt(11**2 + 11**2)],
|
||||
),
|
||||
(
|
||||
[Point(0, 0), Point(1, 1)],
|
||||
@@ -788,7 +788,7 @@ class TestNearest:
|
||||
[Point(1.1, 1.1), Point(0, 0)],
|
||||
[0, 1, 2],
|
||||
[1, 0, 1],
|
||||
[0, np.sqrt(0.1 ** 2 + 0.1 ** 2), 0],
|
||||
[0, np.sqrt(0.1**2 + 0.1**2), 0],
|
||||
),
|
||||
],
|
||||
)
|
||||
@@ -852,21 +852,21 @@ class TestNearest:
|
||||
[Point(-10, -10), Point(100, 100)],
|
||||
[0, 1],
|
||||
[0, 1],
|
||||
[math.sqrt(10 ** 2 + 10 ** 2), math.sqrt(99 ** 2 + 99 ** 2)],
|
||||
[math.sqrt(10**2 + 10**2), math.sqrt(99**2 + 99**2)],
|
||||
),
|
||||
(
|
||||
[Point(0, 0), Point(1, 1)],
|
||||
[Point(x, y) for x, y in zip(np.arange(10), np.arange(10))],
|
||||
[0, 1] + [1] * 8,
|
||||
list(range(10)),
|
||||
[0, 0] + [np.sqrt(x ** 2 + x ** 2) for x in np.arange(1, 9)],
|
||||
[0, 0] + [np.sqrt(x**2 + x**2) for x in np.arange(1, 9)],
|
||||
),
|
||||
(
|
||||
[Point(0, 0), Point(1, 1), Point(0, 0)],
|
||||
[Point(1.1, 1.1), Point(0, 0)],
|
||||
[1, 0, 2],
|
||||
[0, 1, 1],
|
||||
[np.sqrt(0.1 ** 2 + 0.1 ** 2), 0, 0],
|
||||
[np.sqrt(0.1**2 + 0.1**2), 0, 0],
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user