prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  BUG: CRS is missing
  https://github.com/Zeroto521/my-data-toolkit/blob/93aaefa0193c1822af21c60d9edbbc9acff68815/dtoolkit/geoaccessor/series/to_geoframe.py#L86-L87
  
  `np.asarray` will remove CRS information from GeoSeries.
  
  </issue>
  <code>
  [start of dtoolkit/geoaccessor/series/to_geoframe.py]
  1 from __future__ import annotations
  2 
  3 from typing import TYPE_CHECKING
  4 
  5 import geopandas as gpd
  6 import numpy as np
  7 import pandas as pd
  8 from geopandas.base import is_geometry_type
  9 
  10 from dtoolkit.accessor.register import register_series_method
  11 
  12 if TYPE_CHECKING:
  13     from pyproj import CRS
  14 
  15 
  16 @register_series_method
  17 def to_geoframe(
  18     s: pd.Series,
  19     /,
  20     geometry: gpd.GeoSeries = None,
  21     crs: CRS | str | int = None,
  22     **kwargs,
  23 ) -> gpd.GeoDataFrame | pd.DataFrame:
  24     """
  25     Transform an array of shapely scalars :class:`~pandas.Series` to
  26     a :class:`~geopandas.GeoDataFrame`.
  27 
  28     Parameters
  29     ----------
  30     geometry : GeoSeries, optional
  31         It will be prior set as 'geometry' column on GeoDataFrame. If the input
  32         is a GeoSeries, its index will be ignored.
  33 
  34     crs : CRS, str, int, optional
  35         Coordinate Reference System of the geometry objects. Can be anything
  36         accepted by :meth:`~pyproj.crs.CRS.from_user_input`, such as an authority
  37         string (eg "EPSG:4326" / 4326) or a WKT string.
  38 
  39     **kwargs
  40         See the documentation for :class:`~geopandas.GeoDataFrame` and  for complete
  41         details on the keyword arguments.
  42 
  43     Returns
  44     -------
  45     DataFrame or GeoDataFrame
  46         GeoDataFrame if the data is an array of shapely scalars or ``geometry`` is set.
  47 
  48     See Also
  49     --------
  50     dtoolkit.geoaccessor.series.to_geoseries
  51     dtoolkit.geoaccessor.dataframe.to_geoframe
  52 
  53     Examples
  54     --------
  55     >>> import dtoolkit.geoaccessor
  56     >>> import pandas as pd
  57     >>> s = pd.Series(
  58     ...     pd.Series(
  59     ...         [
  60     ...             "POINT (1 1)",
  61     ...             "POINT (2 2)",
  62     ...             "POINT (3 3)",
  63     ...         ],
  64     ...     )
  65     ...     .from_wkt(drop=True, crs=4326)
  66     ... )
  67     >>> s
  68     0    POINT (1.00000 1.00000)
  69     1    POINT (2.00000 2.00000)
  70     2    POINT (3.00000 3.00000)
  71     dtype: geometry
  72     >>> type(s)
  73     <class 'pandas.core.series.Series'>
  74     >>> gs = s.to_geoframe()
  75     >>> gs
  76                         geometry
  77     0    POINT (1.00000 1.00000)
  78     1    POINT (2.00000 2.00000)
  79     2    POINT (3.00000 3.00000)
  80     >>> type(gs)
  81     <class 'geopandas.geodataframe.GeoDataFrame'>
  82     """
  83 
  84     if geometry is not None:
  85         # FIXME: https://github.com/geopandas/geopandas/issues/2660
  86         if isinstance(geometry, gpd.GeoSeries):
  87             geometry = np.asarray(geometry)
  88         return gpd.GeoDataFrame(s, geometry=geometry, crs=crs, **kwargs)
  89     elif is_geometry_type(s):
  90         return gpd.GeoDataFrame(geometry=s, crs=crs, **kwargs)
  91     else:
  92         return s.to_frame()
  93
  [end of dtoolkit/geoaccessor/series/to_geoframe.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/dtoolkit/geoaccessor/series/to_geoframe.py b/dtoolkit/geoaccessor/series/to_geoframe.py
  --- a/dtoolkit/geoaccessor/series/to_geoframe.py
  +++ b/dtoolkit/geoaccessor/series/to_geoframe.py
  @@ -3,7 +3,6 @@
   from typing import TYPE_CHECKING
   
   import geopandas as gpd
  -import numpy as np
   import pandas as pd
   from geopandas.base import is_geometry_type
   
  @@ -84,7 +83,7 @@
       if geometry is not None:
           # FIXME: https://github.com/geopandas/geopandas/issues/2660
           if isinstance(geometry, gpd.GeoSeries):
  -            geometry = np.asarray(geometry)
  +            geometry = geometry.set_axis(s.index)
           return gpd.GeoDataFrame(s, geometry=geometry, crs=crs, **kwargs)
       elif is_geometry_type(s):
           return gpd.GeoDataFrame(geometry=s, crs=crs, **kwargs)
  
verification_info: {"golden_diff": "diff --git a/dtoolkit/geoaccessor/series/to_geoframe.py b/dtoolkit/geoaccessor/series/to_geoframe.py\n--- a/dtoolkit/geoaccessor/series/to_geoframe.py\n+++ b/dtoolkit/geoaccessor/series/to_geoframe.py\n@@ -3,7 +3,6 @@\n from typing import TYPE_CHECKING\n \n import geopandas as gpd\n-import numpy as np\n import pandas as pd\n from geopandas.base import is_geometry_type\n \n@@ -84,7 +83,7 @@\n     if geometry is not None:\n         # FIXME: https://github.com/geopandas/geopandas/issues/2660\n         if isinstance(geometry, gpd.GeoSeries):\n-            geometry = np.asarray(geometry)\n+            geometry = geometry.set_axis(s.index)\n         return gpd.GeoDataFrame(s, geometry=geometry, crs=crs, **kwargs)\n     elif is_geometry_type(s):\n         return gpd.GeoDataFrame(geometry=s, crs=crs, **kwargs)\n", "issue": "BUG: CRS is missing\nhttps://github.com/Zeroto521/my-data-toolkit/blob/93aaefa0193c1822af21c60d9edbbc9acff68815/dtoolkit/geoaccessor/series/to_geoframe.py#L86-L87\r\n\r\n`np.asarray` will remove CRS information from GeoSeries.\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport geopandas as gpd\nimport numpy as np\nimport pandas as pd\nfrom geopandas.base import is_geometry_type\n\nfrom dtoolkit.accessor.register import register_series_method\n\nif TYPE_CHECKING:\n    from pyproj import CRS\n\n\n@register_series_method\ndef to_geoframe(\n    s: pd.Series,\n    /,\n    geometry: gpd.GeoSeries = None,\n    crs: CRS | str | int = None,\n    **kwargs,\n) -> gpd.GeoDataFrame | pd.DataFrame:\n    \"\"\"\n    Transform an array of shapely scalars :class:`~pandas.Series` to\n    a :class:`~geopandas.GeoDataFrame`.\n\n    Parameters\n    ----------\n    geometry : GeoSeries, optional\n        It will be prior set as 'geometry' column on GeoDataFrame. If the input\n        is a GeoSeries, its index will be ignored.\n\n    crs : CRS, str, int, optional\n        Coordinate Reference System of the geometry objects. Can be anything\n        accepted by :meth:`~pyproj.crs.CRS.from_user_input`, such as an authority\n        string (eg \"EPSG:4326\" / 4326) or a WKT string.\n\n    **kwargs\n        See the documentation for :class:`~geopandas.GeoDataFrame` and  for complete\n        details on the keyword arguments.\n\n    Returns\n    -------\n    DataFrame or GeoDataFrame\n        GeoDataFrame if the data is an array of shapely scalars or ``geometry`` is set.\n\n    See Also\n    --------\n    dtoolkit.geoaccessor.series.to_geoseries\n    dtoolkit.geoaccessor.dataframe.to_geoframe\n\n    Examples\n    --------\n    >>> import dtoolkit.geoaccessor\n    >>> import pandas as pd\n    >>> s = pd.Series(\n    ...     pd.Series(\n    ...         [\n    ...             \"POINT (1 1)\",\n    ...             \"POINT (2 2)\",\n    ...             \"POINT (3 3)\",\n    ...         ],\n    ...     )\n    ...     .from_wkt(drop=True, crs=4326)\n    ... )\n    >>> s\n    0    POINT (1.00000 1.00000)\n    1    POINT (2.00000 2.00000)\n    2    POINT (3.00000 3.00000)\n    dtype: geometry\n    >>> type(s)\n    <class 'pandas.core.series.Series'>\n    >>> gs = s.to_geoframe()\n    >>> gs\n                        geometry\n    0    POINT (1.00000 1.00000)\n    1    POINT (2.00000 2.00000)\n    2    POINT (3.00000 3.00000)\n    >>> type(gs)\n    <class 'geopandas.geodataframe.GeoDataFrame'>\n    \"\"\"\n\n    if geometry is not None:\n        # FIXME: https://github.com/geopandas/geopandas/issues/2660\n        if isinstance(geometry, gpd.GeoSeries):\n            geometry = np.asarray(geometry)\n        return gpd.GeoDataFrame(s, geometry=geometry, crs=crs, **kwargs)\n    elif is_geometry_type(s):\n        return gpd.GeoDataFrame(geometry=s, crs=crs, **kwargs)\n    else:\n        return s.to_frame()\n", "path": "dtoolkit/geoaccessor/series/to_geoframe.py"}]}