Skip to content

Commit

Permalink
wip (resolving refs)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-joshi committed Jun 18, 2024
1 parent 0acad3d commit 932859f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 17 deletions.
8 changes: 5 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
)
from sphinx.ext.autosummary import Autosummary # isort:skip


class ModinAccessorLevelDocumenter(Documenter):
"""
Performs name resolution for modin Accessor classes like Series.str and Series.dt.
Expand Down Expand Up @@ -157,10 +156,12 @@ def get_items(self, names):
lambda name:
# The trailing . is important here so we don't replace the path for the `str` property
# of the pd.Series class by mistake.
name.replace("Series.str.", "series_utils.StringMethods.").replace(
name.replace(
"Series.str.", "series_utils.StringMethods."
).replace(
"Series.dt.", "series_utils.DatetimeProperties."
),
names,
names
)
)

Expand Down Expand Up @@ -204,6 +205,7 @@ def setup(app):
app.add_autodocumenter(ModinAccessorMethodDocumenter)
app.add_autodocumenter(ModinAccessorAttributeDocumenter)
app.add_directive("autosummary", ModinAutosummary)
breakpoint()


# We overwrite the existing "autosummary" directive in order to properly resolve names for modin
Expand Down
53 changes: 42 additions & 11 deletions docs/source/modin/series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,26 +228,57 @@ Series
.. the current module here.
.. currentmodule:: modin.pandas
.. rubric:: String accessor methods

:doc:`All supported Series str APIs <supported/series_str_supported>`

.. rubric:: Datetime accessor properties

:doc:`All supported Series dt APIs <supported/series_dt_supported>`

.. autosummary::
:toctree: pandas_api/
:template: autosummary/modin_accessor_method.rst
:template: autosummary/modin_accessor_attribute.rst

Series.str.replace
Series.str.split
Series.dt.date
Series.dt.year
Series.dt.month
Series.dt.day
Series.dt.hour
Series.dt.minute
Series.dt.second
Series.dt.dayofweek
Series.dt.day_of_week
Series.dt.dayofyear
Series.dt.day_of_year
Series.dt.quarter


.. rubric:: Datetime accessor methods
.. rubric:: String accessor methods

:doc:`All supported Series dt APIs <supported/series_dt_supported>`
:doc:`All supported Series str APIs <supported/series_str_supported>`

.. autosummary::
:toctree: pandas_api/
:template: autosummary/modin_accessor_attribute.rst

Series.dt.date
Series.dt.time
:template: autosummary/modin_accessor_method.rst

Series.str.capitalize
Series.str.casefold
Series.str.center
Series.str.contains
Series.str.count
Series.str.endswith
Series.str.get
Series.str.isdigit
Series.str.islower
Series.str.istitle
Series.str.isupper
Series.str.len
Series.str.lower
Series.str.lstrip
Series.str.match
Series.str.replace
Series.str.rstrip
Series.str.slice
Series.str.split
Series.str.startswith
Series.str.strip
Series.str.upper
3 changes: 0 additions & 3 deletions docs/source/modin/supported/series_str_supported.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ the method in the left column.
+-----------------------------+---------------------------------+----------------------------------------------------+
| ``slice_replace`` | N | |
+-----------------------------+---------------------------------+----------------------------------------------------+
| ``replace`` | P | ``N`` if `pat` is non-string, `repl` is |
| | | non-string, or `n` is non-numeric or zero. |
+-----------------------------+---------------------------------+----------------------------------------------------+
| ``split`` | P | ``N`` if `pat` is non-string, `n` is non-numeric, |
| | | `expand` is set, or `regex` is set. |
+-----------------------------+---------------------------------+----------------------------------------------------+
Expand Down

0 comments on commit 932859f

Please sign in to comment.