@@ -191,14 +191,15 @@ def test_geopandas_plot_int_dtypes(gdf_ridge, dtype):
191191 This is a regression test for
192192 https://github.com/GenericMappingTools/pygmt/issues/2497
193193 """
194+ gdf = gdf_ridge .copy ()
194195 # Convert NPOINTS column to integer type
195- gdf_ridge ["NPOINTS" ] = gdf_ridge .NPOINTS .astype (dtype = dtype )
196+ gdf ["NPOINTS" ] = gdf .NPOINTS .astype (dtype = dtype )
196197
197198 # Plot figure with three polygons colored based on NPOINTS value
198199 fig = Figure ()
199200 makecpt (cmap = "lisbon" , series = [10 , 60 , 10 ], continuous = True )
200201 fig .plot (
201- data = gdf_ridge ,
202+ data = gdf ,
202203 frame = True ,
203204 pen = "1p,black" ,
204205 fill = "+z" ,
@@ -215,21 +216,22 @@ def test_geopandas_plot_int64_as_float(gdf_ridge):
215216 Check that big 64-bit integers are correctly mapped to float type in
216217 geopandas.GeoDataFrame object.
217218 """
219+ gdf = gdf_ridge .copy ()
218220 factor = 2 ** 32
219221 # 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
222224
223225 # 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
225227
226228 # Plot figure with three polygons colored based on NPOINTS value
227229 fig = Figure ()
228230 makecpt (
229231 cmap = "lisbon" , series = [10 * factor , 60 * factor , 10 * factor ], continuous = True
230232 )
231233 fig .plot (
232- data = gdf_ridge ,
234+ data = gdf ,
233235 frame = True ,
234236 pen = "1p,black" ,
235237 fill = "+z" ,
0 commit comments