Skip to content

Commit

Permalink
Doc/59592/fix docstring validation errors (#59611)
Browse files Browse the repository at this point in the history
* adding extended summary, populating return description and adding see also section

* populating return description section

* populating return description section

* fixing zfil docstrign as per PR #59597

* removing methods whose docstrign has been fixed from code_checks.sh script

---------

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
  • Loading branch information
specialkapa and mroeschke authored Aug 28, 2024
1 parent 91541c1 commit 220c18d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
-i "pandas.MultiIndex.to_frame RT03" \
-i "pandas.NA SA01" \
-i "pandas.NaT SA01" \
-i "pandas.Period.freq GL08" \
Expand Down Expand Up @@ -128,7 +127,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timedelta.to_timedelta64 SA01" \
-i "pandas.Timedelta.total_seconds SA01" \
-i "pandas.Timedelta.view SA01" \
-i "pandas.TimedeltaIndex.as_unit RT03,SA01" \
-i "pandas.TimedeltaIndex.components SA01" \
-i "pandas.TimedeltaIndex.microseconds SA01" \
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,25 @@ def as_unit(self, unit: str) -> Self:
"""
Convert to a dtype with the given unit resolution.
This method is for converting the dtype of a ``DatetimeIndex`` or
``TimedeltaIndex`` to a new dtype with the given unit
resolution/precision.
Parameters
----------
unit : {'s', 'ms', 'us', 'ns'}
Returns
-------
same type as self
Converted to the specified unit.
See Also
--------
Timestamp.as_unit : Convert to the given unit.
Timedelta.as_unit : Convert to the given unit.
DatetimeIndex.as_unit : Convert to the given unit.
TimedeltaIndex.as_unit : Convert to the given unit.
Examples
--------
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,7 @@ def to_frame(
Returns
-------
DataFrame
DataFrame representation of the MultiIndex, with levels as columns.
See Also
--------
Expand Down

0 comments on commit 220c18d

Please sign in to comment.