mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-21 13:00:14 +08:00
BUG/TST: fix failing tests with dev versions of pandas and matplotlib (#1588)
* BUG/TST: fix failing tests with dev versions of pandas and matplotlib * fixup
This commit is contained in:
+1
-1
@@ -1035,7 +1035,7 @@ class GeometryArray(ExtensionArray):
|
||||
ovalues = [param] * len(self)
|
||||
return ovalues
|
||||
|
||||
if isinstance(other, (pd.Series, pd.Index)):
|
||||
if isinstance(other, (pd.Series, pd.Index, pd.DataFrame)):
|
||||
# rely on pandas to unbox and dispatch to us
|
||||
return NotImplemented
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ class TestPointPlotting:
|
||||
# the colorbar matches the Point colors
|
||||
ax = self.df.plot(column="values", cmap="RdYlGn", legend=True)
|
||||
point_colors = ax.collections[0].get_facecolors()
|
||||
cbar_colors = ax.get_figure().axes[1].collections[0].get_facecolors()
|
||||
cbar_colors = ax.get_figure().axes[1].collections[-1].get_facecolors()
|
||||
# first point == bottom of colorbar
|
||||
np.testing.assert_array_equal(point_colors[0], cbar_colors[0])
|
||||
# last point == top of colorbar
|
||||
@@ -198,7 +198,7 @@ class TestPointPlotting:
|
||||
# the colorbar matches the Point colors
|
||||
ax = self.df.plot(column="values", categorical=True, legend=True)
|
||||
point_colors = ax.collections[0].get_facecolors()
|
||||
cbar_colors = ax.get_legend().axes.collections[0].get_facecolors()
|
||||
cbar_colors = ax.get_legend().axes.collections[-1].get_facecolors()
|
||||
# first point == bottom of colorbar
|
||||
np.testing.assert_array_equal(point_colors[0], cbar_colors[0])
|
||||
# last point == top of colorbar
|
||||
@@ -211,7 +211,7 @@ class TestPointPlotting:
|
||||
)
|
||||
ax = self.df[1:].plot(column="exp", cmap="RdYlGn", legend=True, norm=norm)
|
||||
point_colors = ax.collections[0].get_facecolors()
|
||||
cbar_colors = ax.get_figure().axes[1].collections[0].get_facecolors()
|
||||
cbar_colors = ax.get_figure().axes[1].collections[-1].get_facecolors()
|
||||
# first point == bottom of colorbar
|
||||
np.testing.assert_array_equal(point_colors[0], cbar_colors[0])
|
||||
# last point == top of colorbar
|
||||
|
||||
Reference in New Issue
Block a user