@@ -191,14 +191,15 @@ def test_geopandas_plot_int_dtypes(gdf_ridge, dtype):
191
191
This is a regression test for
192
192
https://github.com/GenericMappingTools/pygmt/issues/2497
193
193
"""
194
+ gdf = gdf_ridge .copy ()
194
195
# Convert NPOINTS column to integer type
195
- gdf_ridge ["NPOINTS" ] = gdf_ridge .NPOINTS .astype (dtype = dtype )
196
+ gdf ["NPOINTS" ] = gdf .NPOINTS .astype (dtype = dtype )
196
197
197
198
# Plot figure with three polygons colored based on NPOINTS value
198
199
fig = Figure ()
199
200
makecpt (cmap = "lisbon" , series = [10 , 60 , 10 ], continuous = True )
200
201
fig .plot (
201
- data = gdf_ridge ,
202
+ data = gdf ,
202
203
frame = True ,
203
204
pen = "1p,black" ,
204
205
fill = "+z" ,
@@ -215,21 +216,22 @@ def test_geopandas_plot_int64_as_float(gdf_ridge):
215
216
Check that big 64-bit integers are correctly mapped to float type in
216
217
geopandas.GeoDataFrame object.
217
218
"""
219
+ gdf = gdf_ridge .copy ()
218
220
factor = 2 ** 32
219
221
# Convert NPOINTS column to int64 type and make big integers
220
- gdf_ridge ["NPOINTS" ] = gdf_ridge .NPOINTS .astype (dtype = "int64" )
221
- gdf_ridge ["NPOINTS" ] *= factor
222
+ gdf ["NPOINTS" ] = gdf .NPOINTS .astype (dtype = "int64" )
223
+ gdf ["NPOINTS" ] *= factor
222
224
223
225
# Make sure the column is bigger than the largest 32-bit integer
224
- assert gdf_ridge ["NPOINTS" ].abs ().max () > 2 ** 31 - 1
226
+ assert gdf ["NPOINTS" ].abs ().max () > 2 ** 31 - 1
225
227
226
228
# Plot figure with three polygons colored based on NPOINTS value
227
229
fig = Figure ()
228
230
makecpt (
229
231
cmap = "lisbon" , series = [10 * factor , 60 * factor , 10 * factor ], continuous = True
230
232
)
231
233
fig .plot (
232
- data = gdf_ridge ,
234
+ data = gdf ,
233
235
frame = True ,
234
236
pen = "1p,black" ,
235
237
fill = "+z" ,
0 commit comments