Skip to content

Commit

Permalink
DOC: add pandas intersphinx mapping (#15531)
Browse files Browse the repository at this point in the history
This PR add pandas to intersphinx mapping to make it easy to link to pandas docs from the RAPIDS docs.

There is likely other opportunities to use the pandas intersphinx mapping e.g. #15383 but I think they can be subsequent PRs.

I've tested this locally and confirm it works as expected (i.e. the note in the docstring at https://docs.rapids.ai/api/cudf/stable/user_guide/api_docs/api/cudf.dataframe.query/#cudf.DataFrame.query is now hyperlinked to https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.query.html

![Screenshot 2024-04-14 at 2 15 33 AM](https://github.com/rapidsai/cudf/assets/17162724/193076e2-202e-4e74-9305-be1dbcdfa82b)

Apologies about the other linting. I can revert if need be

Authors:
  - Ray Bell (https://github.com/raybellwaves)
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #15531
  • Loading branch information
raybellwaves authored Apr 18, 2024
1 parent a935066 commit cb8e434
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions docs/cudf/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ def clean_all_xml_files(path):
tree.write(fn)




# Breathe Configuration
breathe_projects = {"libcudf": "../../../cpp/doxygen/xml"}
for project_path in breathe_projects.values():
Expand Down Expand Up @@ -187,7 +185,9 @@ def clean_all_xml_files(path):
# The short X.Y version.
version = f"{CUDF_VERSION.major:02}.{CUDF_VERSION.minor:02}"
# The full version.
release = f"{CUDF_VERSION.major:02}.{CUDF_VERSION.minor:02}.{CUDF_VERSION.micro:02}"
release = (
f"{CUDF_VERSION.major:02}.{CUDF_VERSION.minor:02}.{CUDF_VERSION.micro:02}"
)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -308,7 +308,10 @@ def clean_all_xml_files(path):
"dlpack": ("https://dmlc.github.io/dlpack/latest/", None),
"nanoarrow": ("https://arrow.apache.org/nanoarrow/latest", None),
"numpy": ("https://numpy.org/doc/stable", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"pandas": (
"https://pandas.pydata.org/pandas-docs/stable/",
None,
),
"pyarrow": ("https://arrow.apache.org/docs/", None),
"python": ("https://docs.python.org/3", None),
"rmm": ("https://docs.rapids.ai/api/rmm/nightly/", None),
Expand Down Expand Up @@ -380,7 +383,7 @@ def _generate_namespaces(namespaces):
"type_id",
# Unknown base types
"int32_t",
"void"
"void",
}


Expand Down Expand Up @@ -448,9 +451,14 @@ def _cached_intersphinx_lookup(env, node, contnode):

def on_missing_reference(app, env, node, contnode):
# These variables are defined outside the function to speed up the build.
global _all_namespaces, _names_to_skip_in_cpp, \
_names_to_skip_in_pylibcudf, _intersphinx_extra_prefixes, \
_domain_objects, _prefixed_domain_objects, _intersphinx_cache
global \
_all_namespaces, \
_names_to_skip_in_cpp, \
_names_to_skip_in_pylibcudf, \
_intersphinx_extra_prefixes, \
_domain_objects, \
_prefixed_domain_objects, \
_intersphinx_cache

# Precompute and cache domains for faster lookups
if _domain_objects is None:
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4320,7 +4320,7 @@ def query(self, expr, local_dict=None):
"""
Query with a boolean expression using Numba to compile a GPU kernel.
See pandas.DataFrame.query.
See :meth:`pandas.DataFrame.query`.
Parameters
----------
Expand Down

0 comments on commit cb8e434

Please sign in to comment.