We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
BUG: fix jupyer notebook can’t render
<!--
Thanks for contributing a pull request!

Please follow these standard acronyms to start the commit message:

- ENH: enhancement
- BUG: bug fix
- DOC: documentation
- TYP: type annotations
- TST: addition or modification of tests
- MAINT: maintenance commit (refactoring, typos, etc.)
- BLD: change related to building
- REL: related to releasing
- API: an (incompatible) API change
- DEP: deprecate something, or remove a deprecated object
- DEV: development tool or utility
- REV: revert an earlier commit
- PERF: performance improvement
- BOT: always commit via a bot
- CI: related to CI or CD
- CLN: Code cleanup
-->

- [x] closes #436 and https://my-data-toolkit.readthedocs.io/en/v0.0.10/guide/tips_about_getattr.html
- [ ] whatsnew entry


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `doc/source/conf.py`
Content:
```
1 # Configuration file for the Sphinx documentation builder.
2 #
3 # This file only contains a selection of the most common options.
4 # For a full list see the documentation:
5 # https://www.sphinx-doc.org/en/master/usage/configuration.html
6 
7 
8 # -- Project information -----------------------------------------------------
9 
10 # The version info for the project you're documenting, acts as replacement for
11 # |version| and |release|, also used in various other places throughout the
12 # built documents.
13 from __future__ import annotations
14 
15 import inspect
16 import os
17 import sys
18 from datetime import datetime
19 
20 import dtoolkit
21 
22 version = release = dtoolkit.__version__
23 version = version.replace(".dev0", "")
24 version = version.replace(".post0", "")
25 
26 
27 project = "DToolKit"
28 author = "Zero <@Zeroto521>"
29 copyright = f"2021-{datetime.now().year}, {author}"  # pylint: disable=redefined-builtin
30 github_url = "https://github.com/Zeroto521/my-data-toolkit"
31 
32 
33 # -- General configuration ---------------------------------------------------
34 
35 # Add any Sphinx extension module names here, as strings. They can be
36 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37 # ones.
38 extensions = [
39     "myst_parser",
40     "numpydoc",
41     "sphinx.ext.autodoc",
42     "sphinx.ext.autosummary",
43     "sphinx.ext.autosectionlabel",
44     "sphinx.ext.extlinks",
45     "sphinx.ext.intersphinx",
46     "sphinx.ext.linkcode",
47     "sphinx_toggleprompt",
48     "IPython.sphinxext.ipython_console_highlighting",
49     "IPython.sphinxext.ipython_directive",
50     "nbsphinx",
51 ]
52 
53 # The suffix of source filenames.
54 source_suffix = [".rst", ".md"]
55 
56 # Add any paths that contain templates here, relative to this directory.
57 templates_path = ["_templates"]
58 
59 # List of patterns, relative to source directory, that match files and
60 # directories to ignore when looking for source files.
61 # This pattern also affects html_static_path and html_extra_path.
62 exclude_patterns = []
63 
64 
65 # -- Options for HTML output -------------------------------------------------
66 
67 # The theme to use for HTML and HTML Help pages.  See the documentation for
68 # a list of builtin themes.
69 html_theme = "pydata_sphinx_theme"
70 
71 # Theme options are theme-specific and customize the look and feel of a theme
72 # further.  For a list of options available for each theme, see the
73 # documentation.
74 html_theme_options = {
75     "search_bar_position": "sidebar",
76     "github_url": github_url,
77     "icon_links": [
78         {
79             "name": "PyPI",
80             "url": "https://pypi.org/project/my-data-toolkit",
81             "icon": "fas fa-box",
82         },
83     ],
84 }
85 
86 # Add any paths that contain custom static files (such as style sheets) here,
87 # relative to this directory. They are copied after the builtin static files,
88 # so a file named "default.css" will overwrite the builtin "default.css".
89 html_static_path = ["_static"]
90 
91 
92 # Add redirect for previously existing pages, each item is like `(from_old, to_new)`
93 
94 moved_pages = [
95     ("py-modindex", "reference"),
96 ]
97 
98 html_additional_pages = {page[0]: "redirect.html" for page in moved_pages}
99 
100 html_context = {"redirects": dict(moved_pages)}
101 
102 
103 nbsphinx_prolog = r"""
104 {% set docname = env.doc2path(env.docname, base=None) %}
105 
106 .. tip::
107 
108     This page was generated from `{{ docname }}`__.
109 
110     __ :ghlink:`my-data-toolkit/blob/main/doc/source/{{ docname }}`
111 """
112 
113 
114 #  --Options for sphinx extensions -----------------------------------------------
115 
116 # connect docs in other projects
117 intersphinx_mapping = {
118     "python": ("http://docs.python.org/", None),
119     "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
120     "numpy": ("https://numpy.org/doc/stable/", None),
121     "sklearn": ("https://scikit-learn.org/stable/", None),
122     "geopandas": ("https://geopandas.readthedocs.io/en/stable/", None),
123     "shapely": ("https://shapely.readthedocs.io/en/stable/", None),
124     "pyproj": ("https://pyproj4.github.io/pyproj/stable/", None),
125     "pygeos": ("https://pygeos.readthedocs.io/en/stable/", None),
126 }
127 
128 # extlinks alias
129 extlinks = {
130     "issue": (f"{github_url}/issues/%s", "issue#"),
131     "pr": (f"{github_url}/issues/%s", "pr#"),
132     "user": (r"https://github.com/%s", "@"),
133     # github's link
134     "ghlink": (r"https://github.com/%s", None),
135 }
136 
137 myst_enable_extensions = [
138     "colon_fence",
139 ]
140 
141 autosummary_generate = True
142 
143 nbsphinx_execute = "always"
144 nbsphinx_allow_errors = True
145 
146 
147 # based on pandas doc/source/conf.py
148 def linkcode_resolve(domain: str, info: dict[str, str]) -> str | None:
149     """
150     Determine the URL corresponding to Python object
151     """
152 
153     if domain != "py":
154         return None
155 
156     modname = info["module"]
157     fullname = info["fullname"]
158 
159     submod = sys.modules.get(modname)
160     if submod is None:
161         return None
162 
163     obj = submod
164     for part in fullname.split("."):
165         try:
166             obj = getattr(obj, part)
167         except AttributeError:
168             return None
169 
170     try:
171         fn = inspect.getsourcefile(inspect.unwrap(obj))
172     except TypeError:
173         fn = None
174 
175     if not fn:
176         return None
177 
178     # to fix these doc doesn't exist in dtoolkit
179     if project.lower() not in fn:
180         return None
181 
182     try:
183         source, lineno = inspect.getsourcelines(obj)
184     except OSError:
185         lineno = None
186 
187     linespec = f"#L{lineno}-L{lineno + len(source) - 1}" if lineno else ""
188     fn = os.path.relpath(fn, start=os.path.dirname(dtoolkit.__file__))
189 
190     base_link = f"{github_url}/blob/" + "{branch}" + f"/dtoolkit/{fn}{linespec}"
191     if "post" in version:
192         return base_link.format(branch="main")
193 
194     return base_link.format(branch=f"v{version}")
195
```

Path: `dtoolkit/geoaccessor/accessor.py`
Content:
```
1 import geopandas as gpd
2 from pandas.core.accessor import _register_accessor
3 from pandas.util._decorators import doc
4 
5 
6 @doc(klass=":class:`~geopandas.GeoSeries`")
7 def register_geoseries_accessor(name: str):
8     """
9     Register a custom accessor on {klass} objects.
10 
11     This is a temparatory solution to hook method into
12     :class:`~geopandas.GeoSeries` or :class:`~geopandas.GeoDataFrame`.
13     If `geopandas#1952`_ done, it would be removed from
14     :mod:`dtoolkit.geoaccessor`.
15 
16     .. _geopandas#1952: :ghlink:`geopandas/geopandas/pull/1952`
17 
18     Parameters
19     ----------
20     name : str
21         Name under which the accessor should be registered. A warning is issued
22         if this name conflicts with a preexisting attribute.
23 
24     Returns
25     -------
26     callable
27         A class decorator.
28 
29     See Also
30     --------
31     register_geoseries_accessor
32     register_geodataframe_accessor
33     dtoolkit.geoaccessor.register_geoseries_method
34     dtoolkit.geoaccessor.register_geodataframe_method
35 
36     Notes
37     -----
38     When accessed, your accessor will be initialized with the geopandas object
39     the user is interacting with. So the signature must be::
40 
41         def __init__(self, geopandas_object):  # noqa: E999
42             ...
43 
44     For consistency with geopandas methods, you should raise an
45     ``AttributeError`` if the data passed to your accessor has an incorrect
46     dtype.
47 
48     >>> import geopandas as gpd
49     >>> gpd.GeoSeries().dt
50     Traceback (most recent call last):
51     ...
52     AttributeError: Can only use .dt accessor with datetimelike values
53 
54     Examples
55     --------
56     In your library code::
57 
58         from pygeos import count_coordinates, from_shapely
59 
60         @register_geodataframe_accessor("coords")
61         @register_geoseries_accessor("coords")
62         class CoordinateAccessor:
63             def __init__(self, gpd_obj):
64                 self._obj = gpd_obj
65                 self.geometry = gpd_obj.geometry
66 
67             @property
68             def count_coordinates(self):
69                 # Counts the number of coordinate pairs in geometry
70 
71                 return self.geometry.apply(count_coordinates(from_shapely(x)))
72 
73     Back in an interactive IPython session:
74 
75     .. code-block:: ipython
76 
77         In [1]: import geopandas as gpd
78 
79         In [2]: s = gpd.GeoSeries.from_wkt(["POINT (0 0)", "POINT (1 1)", None])
80 
81         In [3]: s
82         Out[3]:
83         0    POINT (0.00000 0.00000)
84         1    POINT (1.00000 1.00000)
85         2                       None
86         dtype: geometry
87 
88         In [4]: s.coords.count_coordinates
89         Out[4]:
90         0    1
91         1    1
92         2    0
93         dtype: int64
94 
95         In [5]: d = s.to_frame("geometry")
96         Out[5]:
97                         geometry
98         0  POINT (0.00000 0.00000)
99         1  POINT (1.00000 1.00000)
100         2                     None
101 
102         In [6]: d.coords.count_coordinates
103         Out[6]:
104         0    1
105         1    1
106         2    0
107         Name: geometry, dtype: int64
108     """
109 
110     return _register_accessor(name, gpd.GeoSeries)
111 
112 
113 @doc(register_geoseries_accessor, klass=":class:`~geopandas.GeoDataFrame`")
114 def register_geodataframe_accessor(name: str):
115 
116     return _register_accessor(name, gpd.GeoDataFrame)
117
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -107,7 +107,7 @@
 
     This page was generated from `{{ docname }}`__.
 
-    __ :ghlink:`my-data-toolkit/blob/main/doc/source/{{ docname }}`
+    __ https://github.com/zeroto521/my-data-toolkit/blob/main/doc/source/{{ docname }}
 """
 
 
@@ -130,8 +130,6 @@
     "issue": (f"{github_url}/issues/%s", "issue#"),
     "pr": (f"{github_url}/issues/%s", "pr#"),
     "user": (r"https://github.com/%s", "@"),
-    # github's link
-    "ghlink": (r"https://github.com/%s", None),
 }
 
 myst_enable_extensions = [
diff --git a/dtoolkit/geoaccessor/accessor.py b/dtoolkit/geoaccessor/accessor.py
--- a/dtoolkit/geoaccessor/accessor.py
+++ b/dtoolkit/geoaccessor/accessor.py
@@ -13,7 +13,7 @@
     If `geopandas#1952`_ done, it would be removed from
     :mod:`dtoolkit.geoaccessor`.
 
-    .. _geopandas#1952: :ghlink:`geopandas/geopandas/pull/1952`
+    .. _geopandas#1952: https://github.com/geopandas/geopandas/pull/1952
 
     Parameters
     ----------

{"golden_diff": "diff --git a/doc/source/conf.py b/doc/source/conf.py\n--- a/doc/source/conf.py\n+++ b/doc/source/conf.py\n@@ -107,7 +107,7 @@\n \n     This page was generated from `{{ docname }}`__.\n \n-    __ :ghlink:`my-data-toolkit/blob/main/doc/source/{{ docname }}`\n+    __ https://github.com/zeroto521/my-data-toolkit/blob/main/doc/source/{{ docname }}\n \"\"\"\n \n \n@@ -130,8 +130,6 @@\n     \"issue\": (f\"{github_url}/issues/%s\", \"issue#\"),\n     \"pr\": (f\"{github_url}/issues/%s\", \"pr#\"),\n     \"user\": (r\"https://github.com/%s\", \"@\"),\n-    # github's link\n-    \"ghlink\": (r\"https://github.com/%s\", None),\n }\n \n myst_enable_extensions = [\ndiff --git a/dtoolkit/geoaccessor/accessor.py b/dtoolkit/geoaccessor/accessor.py\n--- a/dtoolkit/geoaccessor/accessor.py\n+++ b/dtoolkit/geoaccessor/accessor.py\n@@ -13,7 +13,7 @@\n     If `geopandas#1952`_ done, it would be removed from\n     :mod:`dtoolkit.geoaccessor`.\n \n-    .. _geopandas#1952: :ghlink:`geopandas/geopandas/pull/1952`\n+    .. _geopandas#1952: https://github.com/geopandas/geopandas/pull/1952\n \n     Parameters\n     ----------\n", "issue": "BUG: fix jupyer notebook can\u2019t render\n<!--\r\nThanks for contributing a pull request!\r\n\r\nPlease follow these standard acronyms to start the commit message:\r\n\r\n- ENH: enhancement\r\n- BUG: bug fix\r\n- DOC: documentation\r\n- TYP: type annotations\r\n- TST: addition or modification of tests\r\n- MAINT: maintenance commit (refactoring, typos, etc.)\r\n- BLD: change related to building\r\n- REL: related to releasing\r\n- API: an (incompatible) API change\r\n- DEP: deprecate something, or remove a deprecated object\r\n- DEV: development tool or utility\r\n- REV: revert an earlier commit\r\n- PERF: performance improvement\r\n- BOT: always commit via a bot\r\n- CI: related to CI or CD\r\n- CLN: Code cleanup\r\n-->\r\n\r\n- [x] closes #436 and https://my-data-toolkit.readthedocs.io/en/v0.0.10/guide/tips_about_getattr.html\r\n- [ ] whatsnew entry\r\n\n", "before_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options.\n# For a full list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n\n# -- Project information -----------------------------------------------------\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\nfrom __future__ import annotations\n\nimport inspect\nimport os\nimport sys\nfrom datetime import datetime\n\nimport dtoolkit\n\nversion = release = dtoolkit.__version__\nversion = version.replace(\".dev0\", \"\")\nversion = version.replace(\".post0\", \"\")\n\n\nproject = \"DToolKit\"\nauthor = \"Zero <@Zeroto521>\"\ncopyright = f\"2021-{datetime.now().year}, {author}\"  # pylint: disable=redefined-builtin\ngithub_url = \"https://github.com/Zeroto521/my-data-toolkit\"\n\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"myst_parser\",\n    \"numpydoc\",\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.autosummary\",\n    \"sphinx.ext.autosectionlabel\",\n    \"sphinx.ext.extlinks\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.linkcode\",\n    \"sphinx_toggleprompt\",\n    \"IPython.sphinxext.ipython_console_highlighting\",\n    \"IPython.sphinxext.ipython_directive\",\n    \"nbsphinx\",\n]\n\n# The suffix of source filenames.\nsource_suffix = [\".rst\", \".md\"]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = []\n\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = \"pydata_sphinx_theme\"\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\nhtml_theme_options = {\n    \"search_bar_position\": \"sidebar\",\n    \"github_url\": github_url,\n    \"icon_links\": [\n        {\n            \"name\": \"PyPI\",\n            \"url\": \"https://pypi.org/project/my-data-toolkit\",\n            \"icon\": \"fas fa-box\",\n        },\n    ],\n}\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\n\n# Add redirect for previously existing pages, each item is like `(from_old, to_new)`\n\nmoved_pages = [\n    (\"py-modindex\", \"reference\"),\n]\n\nhtml_additional_pages = {page[0]: \"redirect.html\" for page in moved_pages}\n\nhtml_context = {\"redirects\": dict(moved_pages)}\n\n\nnbsphinx_prolog = r\"\"\"\n{% set docname = env.doc2path(env.docname, base=None) %}\n\n.. tip::\n\n    This page was generated from `{{ docname }}`__.\n\n    __ :ghlink:`my-data-toolkit/blob/main/doc/source/{{ docname }}`\n\"\"\"\n\n\n#  --Options for sphinx extensions -----------------------------------------------\n\n# connect docs in other projects\nintersphinx_mapping = {\n    \"python\": (\"http://docs.python.org/\", None),\n    \"pandas\": (\"https://pandas.pydata.org/pandas-docs/stable/\", None),\n    \"numpy\": (\"https://numpy.org/doc/stable/\", None),\n    \"sklearn\": (\"https://scikit-learn.org/stable/\", None),\n    \"geopandas\": (\"https://geopandas.readthedocs.io/en/stable/\", None),\n    \"shapely\": (\"https://shapely.readthedocs.io/en/stable/\", None),\n    \"pyproj\": (\"https://pyproj4.github.io/pyproj/stable/\", None),\n    \"pygeos\": (\"https://pygeos.readthedocs.io/en/stable/\", None),\n}\n\n# extlinks alias\nextlinks = {\n    \"issue\": (f\"{github_url}/issues/%s\", \"issue#\"),\n    \"pr\": (f\"{github_url}/issues/%s\", \"pr#\"),\n    \"user\": (r\"https://github.com/%s\", \"@\"),\n    # github's link\n    \"ghlink\": (r\"https://github.com/%s\", None),\n}\n\nmyst_enable_extensions = [\n    \"colon_fence\",\n]\n\nautosummary_generate = True\n\nnbsphinx_execute = \"always\"\nnbsphinx_allow_errors = True\n\n\n# based on pandas doc/source/conf.py\ndef linkcode_resolve(domain: str, info: dict[str, str]) -> str | None:\n    \"\"\"\n    Determine the URL corresponding to Python object\n    \"\"\"\n\n    if domain != \"py\":\n        return None\n\n    modname = info[\"module\"]\n    fullname = info[\"fullname\"]\n\n    submod = sys.modules.get(modname)\n    if submod is None:\n        return None\n\n    obj = submod\n    for part in fullname.split(\".\"):\n        try:\n            obj = getattr(obj, part)\n        except AttributeError:\n            return None\n\n    try:\n        fn = inspect.getsourcefile(inspect.unwrap(obj))\n    except TypeError:\n        fn = None\n\n    if not fn:\n        return None\n\n    # to fix these doc doesn't exist in dtoolkit\n    if project.lower() not in fn:\n        return None\n\n    try:\n        source, lineno = inspect.getsourcelines(obj)\n    except OSError:\n        lineno = None\n\n    linespec = f\"#L{lineno}-L{lineno + len(source) - 1}\" if lineno else \"\"\n    fn = os.path.relpath(fn, start=os.path.dirname(dtoolkit.__file__))\n\n    base_link = f\"{github_url}/blob/\" + \"{branch}\" + f\"/dtoolkit/{fn}{linespec}\"\n    if \"post\" in version:\n        return base_link.format(branch=\"main\")\n\n    return base_link.format(branch=f\"v{version}\")\n", "path": "doc/source/conf.py"}, {"content": "import geopandas as gpd\nfrom pandas.core.accessor import _register_accessor\nfrom pandas.util._decorators import doc\n\n\n@doc(klass=\":class:`~geopandas.GeoSeries`\")\ndef register_geoseries_accessor(name: str):\n    \"\"\"\n    Register a custom accessor on {klass} objects.\n\n    This is a temparatory solution to hook method into\n    :class:`~geopandas.GeoSeries` or :class:`~geopandas.GeoDataFrame`.\n    If `geopandas#1952`_ done, it would be removed from\n    :mod:`dtoolkit.geoaccessor`.\n\n    .. _geopandas#1952: :ghlink:`geopandas/geopandas/pull/1952`\n\n    Parameters\n    ----------\n    name : str\n        Name under which the accessor should be registered. A warning is issued\n        if this name conflicts with a preexisting attribute.\n\n    Returns\n    -------\n    callable\n        A class decorator.\n\n    See Also\n    --------\n    register_geoseries_accessor\n    register_geodataframe_accessor\n    dtoolkit.geoaccessor.register_geoseries_method\n    dtoolkit.geoaccessor.register_geodataframe_method\n\n    Notes\n    -----\n    When accessed, your accessor will be initialized with the geopandas object\n    the user is interacting with. So the signature must be::\n\n        def __init__(self, geopandas_object):  # noqa: E999\n            ...\n\n    For consistency with geopandas methods, you should raise an\n    ``AttributeError`` if the data passed to your accessor has an incorrect\n    dtype.\n\n    >>> import geopandas as gpd\n    >>> gpd.GeoSeries().dt\n    Traceback (most recent call last):\n    ...\n    AttributeError: Can only use .dt accessor with datetimelike values\n\n    Examples\n    --------\n    In your library code::\n\n        from pygeos import count_coordinates, from_shapely\n\n        @register_geodataframe_accessor(\"coords\")\n        @register_geoseries_accessor(\"coords\")\n        class CoordinateAccessor:\n            def __init__(self, gpd_obj):\n                self._obj = gpd_obj\n                self.geometry = gpd_obj.geometry\n\n            @property\n            def count_coordinates(self):\n                # Counts the number of coordinate pairs in geometry\n\n                return self.geometry.apply(count_coordinates(from_shapely(x)))\n\n    Back in an interactive IPython session:\n\n    .. code-block:: ipython\n\n        In [1]: import geopandas as gpd\n\n        In [2]: s = gpd.GeoSeries.from_wkt([\"POINT (0 0)\", \"POINT (1 1)\", None])\n\n        In [3]: s\n        Out[3]:\n        0    POINT (0.00000 0.00000)\n        1    POINT (1.00000 1.00000)\n        2                       None\n        dtype: geometry\n\n        In [4]: s.coords.count_coordinates\n        Out[4]:\n        0    1\n        1    1\n        2    0\n        dtype: int64\n\n        In [5]: d = s.to_frame(\"geometry\")\n        Out[5]:\n                        geometry\n        0  POINT (0.00000 0.00000)\n        1  POINT (1.00000 1.00000)\n        2                     None\n\n        In [6]: d.coords.count_coordinates\n        Out[6]:\n        0    1\n        1    1\n        2    0\n        Name: geometry, dtype: int64\n    \"\"\"\n\n    return _register_accessor(name, gpd.GeoSeries)\n\n\n@doc(register_geoseries_accessor, klass=\":class:`~geopandas.GeoDataFrame`\")\ndef register_geodataframe_accessor(name: str):\n\n    return _register_accessor(name, gpd.GeoDataFrame)\n", "path": "dtoolkit/geoaccessor/accessor.py"}], "after_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options.\n# For a full list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n\n# -- Project information -----------------------------------------------------\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\nfrom __future__ import annotations\n\nimport inspect\nimport os\nimport sys\nfrom datetime import datetime\n\nimport dtoolkit\n\nversion = release = dtoolkit.__version__\nversion = version.replace(\".dev0\", \"\")\nversion = version.replace(\".post0\", \"\")\n\n\nproject = \"DToolKit\"\nauthor = \"Zero <@Zeroto521>\"\ncopyright = f\"2021-{datetime.now().year}, {author}\"  # pylint: disable=redefined-builtin\ngithub_url = \"https://github.com/Zeroto521/my-data-toolkit\"\n\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"myst_parser\",\n    \"numpydoc\",\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.autosummary\",\n    \"sphinx.ext.autosectionlabel\",\n    \"sphinx.ext.extlinks\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.linkcode\",\n    \"sphinx_toggleprompt\",\n    \"IPython.sphinxext.ipython_console_highlighting\",\n    \"IPython.sphinxext.ipython_directive\",\n    \"nbsphinx\",\n]\n\n# The suffix of source filenames.\nsource_suffix = [\".rst\", \".md\"]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = []\n\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = \"pydata_sphinx_theme\"\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\nhtml_theme_options = {\n    \"search_bar_position\": \"sidebar\",\n    \"github_url\": github_url,\n    \"icon_links\": [\n        {\n            \"name\": \"PyPI\",\n            \"url\": \"https://pypi.org/project/my-data-toolkit\",\n            \"icon\": \"fas fa-box\",\n        },\n    ],\n}\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\n\n# Add redirect for previously existing pages, each item is like `(from_old, to_new)`\n\nmoved_pages = [\n    (\"py-modindex\", \"reference\"),\n]\n\nhtml_additional_pages = {page[0]: \"redirect.html\" for page in moved_pages}\n\nhtml_context = {\"redirects\": dict(moved_pages)}\n\n\nnbsphinx_prolog = r\"\"\"\n{% set docname = env.doc2path(env.docname, base=None) %}\n\n.. tip::\n\n    This page was generated from `{{ docname }}`__.\n\n    __ https://github.com/zeroto521/my-data-toolkit/blob/main/doc/source/{{ docname }}\n\"\"\"\n\n\n#  --Options for sphinx extensions -----------------------------------------------\n\n# connect docs in other projects\nintersphinx_mapping = {\n    \"python\": (\"http://docs.python.org/\", None),\n    \"pandas\": (\"https://pandas.pydata.org/pandas-docs/stable/\", None),\n    \"numpy\": (\"https://numpy.org/doc/stable/\", None),\n    \"sklearn\": (\"https://scikit-learn.org/stable/\", None),\n    \"geopandas\": (\"https://geopandas.readthedocs.io/en/stable/\", None),\n    \"shapely\": (\"https://shapely.readthedocs.io/en/stable/\", None),\n    \"pyproj\": (\"https://pyproj4.github.io/pyproj/stable/\", None),\n    \"pygeos\": (\"https://pygeos.readthedocs.io/en/stable/\", None),\n}\n\n# extlinks alias\nextlinks = {\n    \"issue\": (f\"{github_url}/issues/%s\", \"issue#\"),\n    \"pr\": (f\"{github_url}/issues/%s\", \"pr#\"),\n    \"user\": (r\"https://github.com/%s\", \"@\"),\n}\n\nmyst_enable_extensions = [\n    \"colon_fence\",\n]\n\nautosummary_generate = True\n\nnbsphinx_execute = \"always\"\nnbsphinx_allow_errors = True\n\n\n# based on pandas doc/source/conf.py\ndef linkcode_resolve(domain: str, info: dict[str, str]) -> str | None:\n    \"\"\"\n    Determine the URL corresponding to Python object\n    \"\"\"\n\n    if domain != \"py\":\n        return None\n\n    modname = info[\"module\"]\n    fullname = info[\"fullname\"]\n\n    submod = sys.modules.get(modname)\n    if submod is None:\n        return None\n\n    obj = submod\n    for part in fullname.split(\".\"):\n        try:\n            obj = getattr(obj, part)\n        except AttributeError:\n            return None\n\n    try:\n        fn = inspect.getsourcefile(inspect.unwrap(obj))\n    except TypeError:\n        fn = None\n\n    if not fn:\n        return None\n\n    # to fix these doc doesn't exist in dtoolkit\n    if project.lower() not in fn:\n        return None\n\n    try:\n        source, lineno = inspect.getsourcelines(obj)\n    except OSError:\n        lineno = None\n\n    linespec = f\"#L{lineno}-L{lineno + len(source) - 1}\" if lineno else \"\"\n    fn = os.path.relpath(fn, start=os.path.dirname(dtoolkit.__file__))\n\n    base_link = f\"{github_url}/blob/\" + \"{branch}\" + f\"/dtoolkit/{fn}{linespec}\"\n    if \"post\" in version:\n        return base_link.format(branch=\"main\")\n\n    return base_link.format(branch=f\"v{version}\")\n", "path": "doc/source/conf.py"}, {"content": "import geopandas as gpd\nfrom pandas.core.accessor import _register_accessor\nfrom pandas.util._decorators import doc\n\n\n@doc(klass=\":class:`~geopandas.GeoSeries`\")\ndef register_geoseries_accessor(name: str):\n    \"\"\"\n    Register a custom accessor on {klass} objects.\n\n    This is a temparatory solution to hook method into\n    :class:`~geopandas.GeoSeries` or :class:`~geopandas.GeoDataFrame`.\n    If `geopandas#1952`_ done, it would be removed from\n    :mod:`dtoolkit.geoaccessor`.\n\n    .. _geopandas#1952: https://github.com/geopandas/geopandas/pull/1952\n\n    Parameters\n    ----------\n    name : str\n        Name under which the accessor should be registered. A warning is issued\n        if this name conflicts with a preexisting attribute.\n\n    Returns\n    -------\n    callable\n        A class decorator.\n\n    See Also\n    --------\n    register_geoseries_accessor\n    register_geodataframe_accessor\n    dtoolkit.geoaccessor.register_geoseries_method\n    dtoolkit.geoaccessor.register_geodataframe_method\n\n    Notes\n    -----\n    When accessed, your accessor will be initialized with the geopandas object\n    the user is interacting with. So the signature must be::\n\n        def __init__(self, geopandas_object):  # noqa: E999\n            ...\n\n    For consistency with geopandas methods, you should raise an\n    ``AttributeError`` if the data passed to your accessor has an incorrect\n    dtype.\n\n    >>> import geopandas as gpd\n    >>> gpd.GeoSeries().dt\n    Traceback (most recent call last):\n    ...\n    AttributeError: Can only use .dt accessor with datetimelike values\n\n    Examples\n    --------\n    In your library code::\n\n        from pygeos import count_coordinates, from_shapely\n\n        @register_geodataframe_accessor(\"coords\")\n        @register_geoseries_accessor(\"coords\")\n        class CoordinateAccessor:\n            def __init__(self, gpd_obj):\n                self._obj = gpd_obj\n                self.geometry = gpd_obj.geometry\n\n            @property\n            def count_coordinates(self):\n                # Counts the number of coordinate pairs in geometry\n\n                return self.geometry.apply(count_coordinates(from_shapely(x)))\n\n    Back in an interactive IPython session:\n\n    .. code-block:: ipython\n\n        In [1]: import geopandas as gpd\n\n        In [2]: s = gpd.GeoSeries.from_wkt([\"POINT (0 0)\", \"POINT (1 1)\", None])\n\n        In [3]: s\n        Out[3]:\n        0    POINT (0.00000 0.00000)\n        1    POINT (1.00000 1.00000)\n        2                       None\n        dtype: geometry\n\n        In [4]: s.coords.count_coordinates\n        Out[4]:\n        0    1\n        1    1\n        2    0\n        dtype: int64\n\n        In [5]: d = s.to_frame(\"geometry\")\n        Out[5]:\n                        geometry\n        0  POINT (0.00000 0.00000)\n        1  POINT (1.00000 1.00000)\n        2                     None\n\n        In [6]: d.coords.count_coordinates\n        Out[6]:\n        0    1\n        1    1\n        2    0\n        Name: geometry, dtype: int64\n    \"\"\"\n\n    return _register_accessor(name, gpd.GeoSeries)\n\n\n@doc(register_geoseries_accessor, klass=\":class:`~geopandas.GeoDataFrame`\")\ndef register_geodataframe_accessor(name: str):\n\n    return _register_accessor(name, gpd.GeoDataFrame)\n", "path": "dtoolkit/geoaccessor/accessor.py"}]}