code: def test_dataframe(self):
      arr = from_shapely(self.geoms, crs=27700)
      df = GeoDataFrame(geometry=arr)
      assert df.crs == self.osgb
      assert df.geometry.crs == self.osgb
      assert df.geometry.values.crs == self.osgb
  
      arr = from_shapely(self.geoms)
      s = GeoSeries(arr, crs=27700)
      df = GeoDataFrame(geometry=s)
      assert df.crs == self.osgb
      assert df.geometry.crs == self.osgb
      assert df.geometry.values.crs == self.osgb
  
      # different passed CRS than array CRS is now an error
      match_str = (
          "CRS mismatch between CRS of the passed geometries and 'crs'"
      )
      with pytest.raises(ValueError, match=match_str):
          df = GeoDataFrame(geometry=s, crs=4326)
      with pytest.raises(ValueError, match=match_str):
          GeoDataFrame(geometry=s, crs=4326)
      with pytest.raises(ValueError, match=match_str):
          GeoDataFrame({"data": [1, 2], "geometry": s}, crs=4326)
      with pytest.raises(ValueError, match=match_str):
          GeoDataFrame(df, crs=4326).crs
  
      # manually change CRS
      arr = from_shapely(self.geoms)
      s = GeoSeries(arr, crs=27700)
      df = GeoDataFrame(geometry=s)
      df.crs = 4326
      assert df.crs == self.wgs
      assert df.geometry.crs == self.wgs
      assert df.geometry.values.crs == self.wgs
  
      with pytest.raises(
          ValueError, match="Assigning CRS to a GeoDataFrame without"
      ):
          GeoDataFrame(self.geoms, columns=["geom"], crs=27700)
      with pytest.raises(
          ValueError, match="Assigning CRS to a GeoDataFrame without"
      ):
          GeoDataFrame(crs=27700)
  
      df = GeoDataFrame(self.geoms, columns=["geom"])
      df = df.set_geometry("geom", crs=27700)
      assert df.crs == self.osgb
      assert df.geometry.crs == self.osgb
      assert df.geometry.values.crs == self.osgb
      assert df.geom.crs == self.osgb
      assert df.geom.values.crs == self.osgb
  
      df = GeoDataFrame(geometry=self.geoms, crs=27700)
      assert df.crs == self.osgb
      assert df.geometry.crs == self.osgb
      assert df.geometry.values.crs == self.osgb
  
      # new geometry with set CRS has priority over GDF CRS
      df = GeoDataFrame(geometry=self.geoms, crs=27700)
      df = df.set_geometry(self.geoms, crs=4326)
      assert df.crs == self.wgs
      assert df.geometry.crs == self.wgs
      assert df.geometry.values.crs == self.wgs
  
      arr = from_shapely(self.geoms)
      s = GeoSeries(arr, crs=27700)
      df = GeoDataFrame()
      df = df.set_geometry(s)
      assert df._geometry_column_name == "geometry"
      assert df.crs == self.osgb
      assert df.geometry.crs == self.osgb
      assert df.geometry.values.crs == self.osgb
  
      arr = from_shapely(self.geoms, crs=27700)
      df = GeoDataFrame()
      df = df.set_geometry(arr)
      assert df.crs == self.osgb
      assert df.geometry.crs == self.osgb
      assert df.geometry.values.crs == self.osgb
  
      arr = from_shapely(self.geoms)
      df = GeoDataFrame({"col1": [1, 2], "geometry": arr}, crs=4326)
      assert df.crs == self.wgs
      assert df.geometry.crs == self.wgs
      assert df.geometry.values.crs == self.wgs
  
      arr = from_shapely(self.geoms, crs=4326)
      df = GeoDataFrame({"col1": [1, 2], "geometry": arr})
      assert df.crs == self.wgs
      assert df.geometry.crs == self.wgs
      assert df.geometry.values.crs == self.wgs
  
      # geometry column name None on init
      df = GeoDataFrame({"geometry": [0, 1]})
      with pytest.raises(
          ValueError,
          match="Assigning CRS to a GeoDataFrame without a geometry",
      ):
          df.crs = 27700
  
      # geometry column without geometry
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              "Geometry column does not contain geometry",
              UserWarning,
          )
          df = GeoDataFrame({"geometry": [Point(0, 1)]}).assign(
              geometry=[0]
          )
      with pytest.raises(
          ValueError,
          match="Assigning CRS to a GeoDataFrame without an active geometry",
      ):
          df.crs = 27700
      with pytest.raises(
          AttributeError,
          match="The CRS attribute of a GeoDataFrame without an active",
      ):
          assert df.crs == self.osgb
  
imports: import random
  import warnings
  import numpy
  import pandas
  import pyproj
  import pytest
  from shapely.geometry import Point, Polygon, LineString
  from geopandas import GeoSeries, GeoDataFrame, points_from_xy, read_file
  from geopandas.array import from_shapely, from_wkb, from_wkt, GeometryArray
  from geopandas.testing import assert_geodataframe_equal
label_desc: Use image node_id 4 for calling the TestGeometryArrayCRS obj's underlying member method code with example usage: obj.test_dataframe() without return types