Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] Fix some docs build warnings #10674

Merged
merged 9 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/cudf/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from docutils.nodes import Text
from sphinx.addnodes import pending_xref

import cudf

sys.path.insert(0, os.path.abspath(cudf.__path__[0]))
Expand Down Expand Up @@ -200,6 +201,7 @@
"python": ("https://docs.python.org/3", None),
"cupy": ("https://docs.cupy.dev/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable", None),
"pyarrow": ("https://arrow.apache.org/docs/", None),
}

# Config numpydoc
Expand Down Expand Up @@ -235,10 +237,14 @@ def resolve_aliases(app, doctree):

def ignore_internal_references(app, env, node, contnode):
name = node.get("reftarget", None)
if name is not None and name in _internal_names_to_ignore:
if name == "cudf.core.index.GenericIndex":
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
node["reftarget"] = "cudf.Index"
return contnode
elif name is not None and name in _internal_names_to_ignore:
node["reftarget"] = ""
return contnode


def process_class_docstrings(app, what, name, obj, options, lines):
"""
For those classes for which we use ::
Expand All @@ -258,7 +264,6 @@ def process_class_docstrings(app, what, name, obj, options, lines):

nitpick_ignore = [("py:class", "SeriesOrIndex"),]


def setup(app):
app.add_css_file("params.css")
app.connect("doctree-read", resolve_aliases)
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/_base_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

Parameters
----------
dtype : numpy dtype
Use a numpy.dtype to cast entire Index object to.
dtype : :class:`numpy.dtype`
Use a :class:`numpy.dtype` to cast entire Index object to.
copy : bool, default False
By default, astype always returns a newly allocated object.
If copy is set to False and internal requirements on dtype are
Expand Down
6 changes: 3 additions & 3 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)
from cudf.core.buffer import Buffer
from cudf.core.column import column, datetime
from cudf.core.column.methods import ColumnMethods, ParentType
from cudf.core.column.methods import ColumnMethods
from cudf.utils.docutils import copy_docstring
from cudf.utils.dtypes import can_convert_to_column

Expand Down Expand Up @@ -159,7 +159,7 @@ def htoi(self) -> SeriesOrIndex:

hex_to_int = htoi

def ip2int(self) -> ParentType:
def ip2int(self) -> SeriesOrIndex:
"""
This converts ip strings to integers

Expand Down Expand Up @@ -4950,7 +4950,7 @@ def edit_distance(self, targets) -> SeriesOrIndex:
libstrings.edit_distance(self._column, targets_column)
)

def edit_distance_matrix(self) -> ParentType:
def edit_distance_matrix(self) -> SeriesOrIndex:
"""Computes the edit distance between strings in the series.

The series to compute the matrix should have more than 2 strings and
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def to_cupy(

Parameters
----------
dtype : str or numpy.dtype, optional
dtype : str or :class:`numpy.dtype`, optional
The dtype to pass to :func:`numpy.asarray`.
copy : bool, default False
Whether to ensure that the returned value is not a view on
Expand Down Expand Up @@ -572,7 +572,7 @@ def to_numpy(

Parameters
----------
dtype : str or numpy.dtype, optional
dtype : str or :class:`numpy.dtype`, optional
The dtype to pass to :func:`numpy.asarray`.
copy : bool, default True
Whether to ensure that the returned value is not a view on
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ def transform(self, function):

See also
--------
cudf.core.groupby.GroupBy.agg
agg
"""
try:
result = self.agg(function)
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ class TimedeltaIndex(GenericIndex):
This is not yet supported
closed : str, optional
This is not yet supported
dtype : str or numpy.dtype, optional
dtype : str or :class:`numpy.dtype`, optional
Data type for the output Index. If not specified, the
default dtype will be ``timedelta64[ns]``.
name : object
Expand Down
8 changes: 4 additions & 4 deletions python/cudf/cudf/core/indexed_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2348,10 +2348,10 @@ def astype(self, dtype, copy=False, errors="raise", **kwargs):
Parameters
----------
dtype : data type, or dict of column name -> data type
Use a numpy.dtype or Python type to cast entire DataFrame object to
the same type. Alternatively, use ``{col: dtype, ...}``, where col
is a column label and dtype is a numpy.dtype or Python type
to cast one or more of the DataFrame's columns to
Use a :class:`numpy.dtype` or Python type to cast entire DataFrame
object to the same type. Alternatively, use ``{col: dtype, ...}``,
where col is a column label and dtype is a :class:`numpy.dtype`
or Python type to cast one or more of the DataFrame's columns to
column-specific types.
copy : bool, default False
Return a deep-copy when ``copy=True``. Note by default
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class Series(SingleColumnFrame, IndexedFrame, Serializable):
If both a dict and index sequence are used, the index will
override the keys found in the dict.

dtype : str, numpy.dtype, or ExtensionDtype, optional
dtype : str, :class:`numpy.dtype`, or ExtensionDtype, optional
Data type for the output Series. If not specified,
this will be inferred from data.

Expand Down Expand Up @@ -2129,7 +2129,7 @@ def applymap(self, udf, out_dtype=None):
Either a callable python function or a python function already
decorated by ``numba.cuda.jit`` for call on the GPU as a device

out_dtype : numpy.dtype; optional
out_dtype : :class:`numpy.dtype`; optional
The dtype for use in the output.
Only used for ``numba.cuda.jit`` decorated udf.
By default, the result will have the same dtype as the source.
Expand Down