Skip to content

Commit af10472

Browse files
committed
DOC: Fix PR02 errors in Timedelta attributes (min, max, resolution) docstrings
1 parent d067e08 commit af10472

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7575
-i "pandas.RangeIndex.from_range PR01,SA01" \
7676
-i "pandas.Series.dt.unit GL08" \
7777
-i "pandas.Series.pad PR01,SA01" \
78-
-i "pandas.Timedelta.max PR02" \
79-
-i "pandas.Timedelta.min PR02" \
80-
-i "pandas.Timedelta.resolution PR02" \
8178
-i "pandas.Timestamp.max PR02" \
8279
-i "pandas.Timestamp.min PR02" \
8380
-i "pandas.Timestamp.resolution PR02" \

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,18 @@ class Timedelta(_Timedelta):
18941894
Values for construction in compat with datetime.timedelta.
18951895
Numpy ints and floats will be coerced to python ints and floats.
18961896
1897+
Attributes
1898+
----------
1899+
min : Timedelta
1900+
The minimum representable `Timedelta`, corresponding to the smallest
1901+
duration supported.
1902+
max : Timedelta
1903+
The maximum representable `Timedelta`, corresponding to the largest
1904+
duration supported.
1905+
resolution : Timedelta
1906+
The smallest possible difference between non-equal `Timedelta` objects,
1907+
i.e., `Timedelta(nanoseconds=1)`.
1908+
18971909
See Also
18981910
--------
18991911
Timestamp : Represents a single timestamp in time.
@@ -1933,6 +1945,10 @@ class Timedelta(_Timedelta):
19331945
_req_any_kwargs_new = {"weeks", "days", "hours", "minutes", "seconds",
19341946
"milliseconds", "microseconds", "nanoseconds"}
19351947

1948+
min = Timedelta(np.timedelta64(np.iinfo(np.int64).min + 1, 'ns'))
1949+
max = Timedelta(np.timedelta64(np.iinfo(np.int64).max, 'ns'))
1950+
resolution = Timedelta(1, unit='ns')
1951+
19361952
def __new__(cls, object value=_no_input, unit=None, **kwargs):
19371953
if value is _no_input:
19381954
if not len(kwargs):

0 commit comments

Comments
 (0)