Update to latest version.
This commit is contained in:
parent
bd196b0268
commit
ccbb9de04a
7 changed files with 9 additions and 234 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
/geopandas-0.3.0.tar.gz
|
||||
/geopandas-0.4.0.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
From ff44cd10b0e3bcdb583c034f8450507ed4a461c8 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Tue, 19 Sep 2017 00:48:06 -0400
|
||||
Subject: [PATCH 1/4] Fix default cmap for Matplotlib 2.0.0.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
geopandas/plotting.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/geopandas/plotting.py b/geopandas/plotting.py
|
||||
index 31b6284..a198e50 100644
|
||||
--- a/geopandas/plotting.py
|
||||
+++ b/geopandas/plotting.py
|
||||
@@ -402,8 +402,11 @@ def plot_dataframe(df, column=None, cmap=None, color=None, ax=None,
|
||||
# Define `values` as a Series
|
||||
if categorical:
|
||||
if cmap is None:
|
||||
- if LooseVersion(matplotlib.__version__) >= '2.0':
|
||||
+ if LooseVersion(matplotlib.__version__) >= '2.0.1':
|
||||
cmap = 'tab10'
|
||||
+ elif LooseVersion(matplotlib.__version__) >= '2.0.0':
|
||||
+ # Erroneous name.
|
||||
+ cmap = 'Vega10'
|
||||
else:
|
||||
cmap = 'Set1'
|
||||
categories = list(set(df[column].values))
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
From f1ccfb43a0d0cc400474a60d984e653dfd292063 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Tue, 19 Sep 2017 01:02:43 -0400
|
||||
Subject: [PATCH 2/4] TST: Fix determination of expected dash style.
|
||||
|
||||
In Matplotlib 2.0.0, there was a minimum dash length that was eventually
|
||||
removed because it was problematic. The expected line style does not
|
||||
apply this minimum.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
geopandas/tests/test_plotting.py | 27 +++++++++++++++------------
|
||||
1 file changed, 15 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/geopandas/tests/test_plotting.py b/geopandas/tests/test_plotting.py
|
||||
index b3f98b7..03ab184 100644
|
||||
--- a/geopandas/tests/test_plotting.py
|
||||
+++ b/geopandas/tests/test_plotting.py
|
||||
@@ -184,24 +184,26 @@ class TestLineStringPlotting:
|
||||
_check_colors(self.N, ax.collections[0].get_colors(), ['green']*self.N)
|
||||
|
||||
def test_style_kwargs(self):
|
||||
-
|
||||
# linestyle (style patterns depend on linewidth, therefore pin to 1)
|
||||
linestyle = 'dashed'
|
||||
- ax = self.lines.plot(linestyle=linestyle, linewidth=1)
|
||||
- exp_ls = _style_to_linestring_onoffseq(linestyle)
|
||||
+ linewidth = 1
|
||||
+
|
||||
+ ax = self.lines.plot(linestyle=linestyle, linewidth=linewidth)
|
||||
+ exp_ls = _style_to_linestring_onoffseq(linestyle, linewidth)
|
||||
for ls in ax.collections[0].get_linestyles():
|
||||
assert ls[0] == exp_ls[0]
|
||||
- assert tuple(ls[1]) == exp_ls[1]
|
||||
+ assert ls[1] == exp_ls[1]
|
||||
|
||||
- ax = self.df.plot(linestyle=linestyle, linewidth=1)
|
||||
+ ax = self.df.plot(linestyle=linestyle, linewidth=linewidth)
|
||||
for ls in ax.collections[0].get_linestyles():
|
||||
assert ls[0] == exp_ls[0]
|
||||
- assert tuple(ls[1]) == exp_ls[1]
|
||||
+ assert ls[1] == exp_ls[1]
|
||||
|
||||
- ax = self.df.plot(column='values', linestyle=linestyle, linewidth=1)
|
||||
+ ax = self.df.plot(column='values', linestyle=linestyle,
|
||||
+ linewidth=linewidth)
|
||||
for ls in ax.collections[0].get_linestyles():
|
||||
assert ls[0] == exp_ls[0]
|
||||
- assert tuple(ls[1]) == exp_ls[1]
|
||||
+ assert ls[1] == exp_ls[1]
|
||||
|
||||
|
||||
class TestPolygonPlotting:
|
||||
@@ -469,10 +471,10 @@ class TestPlotCollections:
|
||||
# pass through of kwargs
|
||||
coll = plot_linestring_collection(ax, self.lines, linestyle='--',
|
||||
linewidth=1)
|
||||
- exp_ls = _style_to_linestring_onoffseq('dashed')
|
||||
+ exp_ls = _style_to_linestring_onoffseq('--', 1)
|
||||
res_ls = coll.get_linestyle()[0]
|
||||
assert res_ls[0] == exp_ls[0]
|
||||
- assert tuple(res_ls[1]) == exp_ls[1]
|
||||
+ assert res_ls[1] == exp_ls[1]
|
||||
ax.cla()
|
||||
|
||||
def test_linestrings_values(self):
|
||||
@@ -619,14 +621,15 @@ def _check_colors(N, actual_colors, expected_colors, alpha=None):
|
||||
'{} != {}'.format(actual, conv.to_rgba(expected, alpha=alpha))
|
||||
|
||||
|
||||
-def _style_to_linestring_onoffseq(linestyle):
|
||||
+def _style_to_linestring_onoffseq(linestyle, linewidth):
|
||||
""" Converts a linestyle string representation, namely one of:
|
||||
['dashed', 'dotted', 'dashdot', 'solid'],
|
||||
documented in `Collections.set_linestyle`,
|
||||
to the form `onoffseq`.
|
||||
"""
|
||||
if LooseVersion(matplotlib.__version__) >= '2.0':
|
||||
- return matplotlib.lines._get_dash_pattern(linestyle)
|
||||
+ offset, dashes = matplotlib.lines._get_dash_pattern(linestyle)
|
||||
+ return matplotlib.lines._scale_dashes(offset, dashes, linewidth)
|
||||
else:
|
||||
from matplotlib.backend_bases import GraphicsContextBase
|
||||
return GraphicsContextBase.dashd[linestyle]
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
From 0e9bc3047ad66778835ee5ad2d7d767ac1caec24 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Tue, 28 Nov 2017 02:24:32 -0500
|
||||
Subject: [PATCH 3/4] Workaround test issues on non-x86 systems.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
geopandas/tests/test_overlay.py | 22 ++++++++++++++--------
|
||||
1 file changed, 14 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/geopandas/tests/test_overlay.py b/geopandas/tests/test_overlay.py
|
||||
index d928224..fc7ae2e 100644
|
||||
--- a/geopandas/tests/test_overlay.py
|
||||
+++ b/geopandas/tests/test_overlay.py
|
||||
@@ -34,41 +34,47 @@ class TestDataFrame:
|
||||
# why is the sindex not generated automatically?
|
||||
self.polydf2._generate_sindex()
|
||||
|
||||
- self.union_shape = (180, 7)
|
||||
+ # Some errors on non-x86 cause different results here.
|
||||
+ # https://github.com/geopandas/geopandas/issues/552
|
||||
+ self.union_shape_0 = (180, 182)
|
||||
+ self.union_shape_1 = (7, )
|
||||
|
||||
def test_union(self):
|
||||
df = overlay(self.polydf, self.polydf2, how="union")
|
||||
assert type(df) is GeoDataFrame
|
||||
- assert df.shape == self.union_shape
|
||||
+ assert df.shape[0] in self.union_shape_0
|
||||
+ assert df.shape[1] in self.union_shape_1
|
||||
assert 'value1' in df.columns and 'Shape_Area' in df.columns
|
||||
|
||||
def test_union_no_index(self):
|
||||
# explicitly ignore indicies
|
||||
dfB = overlay(self.polydf, self.polydf2, how="union", use_sindex=False)
|
||||
- assert dfB.shape == self.union_shape
|
||||
+ assert dfB.shape[0] in self.union_shape_0
|
||||
+ assert dfB.shape[1] in self.union_shape_1
|
||||
|
||||
# remove indicies from df
|
||||
self.polydf._sindex = None
|
||||
self.polydf2._sindex = None
|
||||
dfC = overlay(self.polydf, self.polydf2, how="union")
|
||||
- assert dfC.shape == self.union_shape
|
||||
+ assert dfC.shape[0] in self.union_shape_0
|
||||
+ assert dfC.shape[1] in self.union_shape_1
|
||||
|
||||
def test_intersection(self):
|
||||
df = overlay(self.polydf, self.polydf2, how="intersection")
|
||||
assert df['BoroName'][0] is not None
|
||||
- assert df.shape == (68, 7)
|
||||
+ assert df.shape == (68, 7) or df.shape == (69, 7)
|
||||
|
||||
def test_identity(self):
|
||||
df = overlay(self.polydf, self.polydf2, how="identity")
|
||||
- assert df.shape == (154, 7)
|
||||
+ assert df.shape == (154, 7) or df.shape == (156, 7)
|
||||
|
||||
def test_symmetric_difference(self):
|
||||
df = overlay(self.polydf, self.polydf2, how="symmetric_difference")
|
||||
- assert df.shape == (122, 7)
|
||||
+ assert df.shape == (122, 7) or df.shape == (123, 7)
|
||||
|
||||
def test_difference(self):
|
||||
df = overlay(self.polydf, self.polydf2, how="difference")
|
||||
- assert df.shape == (86, 7)
|
||||
+ assert df.shape == (86, 7) or df.shape == (87, 7)
|
||||
|
||||
def test_bad_how(self):
|
||||
with pytest.raises(ValueError):
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
From dd1b97cd2edb24b6940b04dafe1ce48ab54bfc69 Mon Sep 17 00:00:00 2001
|
||||
From: Joris Van den Bossche <jorisvandenbossche@gmail.com>
|
||||
Date: Sat, 17 Mar 2018 20:11:57 +0100
|
||||
Subject: [PATCH 4/4] BUG: fix GeoSeries construction from scalar on pandas
|
||||
master (#692)
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
geopandas/geoseries.py | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/geopandas/geoseries.py b/geopandas/geoseries.py
|
||||
index 2b70752..99df5f2 100644
|
||||
--- a/geopandas/geoseries.py
|
||||
+++ b/geopandas/geoseries.py
|
||||
@@ -32,9 +32,11 @@ class GeoSeries(GeoPandasBase, Series):
|
||||
return arr.view(GeoSeries)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
- # fix problem for scalar geometries passed
|
||||
+ # fix problem for scalar geometries passed, ensure the list of
|
||||
+ # scalars is of correct length if index is specified
|
||||
if len(args) == 1 and isinstance(args[0], BaseGeometry):
|
||||
- args = ([args[0]],)
|
||||
+ n = len(kwargs.get('index', [1]))
|
||||
+ args = ([args[0]] * n,)
|
||||
|
||||
crs = kwargs.pop('crs', None)
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
%global srcname geopandas
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 0.3.0
|
||||
Release: 7%{?dist}
|
||||
Version: 0.4.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Geographic Pandas extensions
|
||||
%global _description \
|
||||
GeoPandas is a project to add support for geographic data to Pandas objects. \
|
||||
|
|
@ -16,13 +16,6 @@ otherwise require a spatial database such as PostGIS.
|
|||
License: BSD
|
||||
URL: https://pypi.python.org/pypi/%{srcname}
|
||||
Source0: https://github.com/%{srcname}/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz
|
||||
# https://github.com/geopandas/geopandas/pull/551 for both
|
||||
Patch0001: 0001-Fix-default-cmap-for-Matplotlib-2.0.0.patch
|
||||
Patch0002: 0002-TST-Fix-determination-of-expected-dash-style.patch
|
||||
# https://github.com/geopandas/geopandas/issues/552
|
||||
Patch0003: 0003-Workaround-test-issues-on-non-x86-systems.patch
|
||||
# https://github.com/geopandas/geopandas/pull/692
|
||||
Patch0004: 0004-BUG-fix-GeoSeries-construction-from-scalar-on-pandas.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
|
|
@ -110,9 +103,9 @@ Requires: python3-shapely >= 1.2.18
|
|||
|
||||
%check
|
||||
PYTHONPATH="%{buildroot}%{python3_sitelib}" \
|
||||
py.test-%{python3_version} -ra geopandas
|
||||
py.test-%{python3_version} -ra geopandas -m 'not web'
|
||||
PYTHONPATH="%{buildroot}%{python2_sitelib}" \
|
||||
py.test-%{python2_version} -ra geopandas
|
||||
py.test-%{python2_version} -ra geopandas -m 'not web'
|
||||
|
||||
|
||||
%files -n python2-%{srcname}
|
||||
|
|
@ -130,6 +123,9 @@ PYTHONPATH="%{buildroot}%{python2_sitelib}" \
|
|||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 18 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.4.0-1
|
||||
- Update to latest version
|
||||
|
||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (geopandas-0.3.0.tar.gz) = bb7c0fedfaa095e7ac7c93dfa3c4909e21c2679d1eb624c17557eb8d533275977d051f885e8a981e6e56b76b956a10e156667a6c99dc1485bbe8ba2dc7042d56
|
||||
SHA512 (geopandas-0.4.0.tar.gz) = da55bf81dec481fa72feebc24e7e3d3a4103a9babde3a079a5abb744f6cd6f991733f8417514b0e79aa90e7761cd1d555fb0eb44278a4f1a2beb06c889f06d9d
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue