Skip to content

DOC: Enforce Numpy Docstring Validation for pandas.Interval.right pandas.Interval.left pandas.Interval.closed #58571

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

Merged
merged 10 commits into from
May 5, 2024
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index.ravel PR01,RT03" \
-i "pandas.Index.str PR01,SA01" \
-i "pandas.Interval PR02" \
-i "pandas.Interval.closed SA01" \
-i "pandas.Interval.left SA01" \
-i "pandas.Interval.right SA01" \
-i "pandas.IntervalIndex.closed SA01" \
-i "pandas.IntervalIndex.contains RT03" \
-i "pandas.IntervalIndex.get_loc PR07,RT03,SA01" \
Expand Down
19 changes: 19 additions & 0 deletions pandas/_libs/interval.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ cdef class Interval(IntervalMixin):
"""
Left bound for the interval.
See Also
--------
Interval.right : Return the right bound for the interval.
numpy.ndarray.left : A similar method in numpy for obtaining
the left endpoint(s) of intervals.
Examples
--------
>>> interval = pd.Interval(left=1, right=2, closed='left')
Expand All @@ -396,6 +402,12 @@ cdef class Interval(IntervalMixin):
"""
Right bound for the interval.
See Also
--------
Interval.left : Return the left bound for the interval.
numpy.ndarray.right : A similar method in numpy for obtaining
the right endpoint(s) of intervals.
Examples
--------
>>> interval = pd.Interval(left=1, right=2, closed='left')
Expand All @@ -411,6 +423,13 @@ cdef class Interval(IntervalMixin):
Either ``left``, ``right``, ``both`` or ``neither``.
See Also
--------
Interval.closed_left : Check if the interval is closed on the left side.
Interval.closed_right : Check if the interval is closed on the right side.
Interval.open_left : Check if the interval is open on the left side.
Interval.open_right : Check if the interval is open on the right side.
Examples
--------
>>> interval = pd.Interval(left=1, right=2, closed='left')
Expand Down