From 71d34ec03a402a327ddb928cc2f43e8f846c51cf Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Sun, 19 May 2024 11:24:47 +0530 Subject: [PATCH 1/2] DOC: add PR07,SA01 for pandas.Timedelta --- ci/code_checks.sh | 1 - pandas/_libs/tslibs/timedeltas.pyx | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index a6447ffe86630..c21b06f0dc355 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -222,7 +222,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.to_markdown SA01" \ -i "pandas.Series.to_string SA01" \ -i "pandas.Series.update PR07,SA01" \ - -i "pandas.Timedelta PR07,SA01" \ -i "pandas.Timedelta.as_unit SA01" \ -i "pandas.Timedelta.asm8 SA01" \ -i "pandas.Timedelta.ceil SA01" \ diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 9078fd4116899..4ff2df34ac717 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1785,6 +1785,7 @@ class Timedelta(_Timedelta): Parameters ---------- value : Timedelta, timedelta, np.timedelta64, str, or int + Input value. unit : str, default 'ns' Denote the unit of the input, if input is an integer. @@ -1810,6 +1811,15 @@ class Timedelta(_Timedelta): Values for construction in compat with datetime.timedelta. Numpy ints and floats will be coerced to python ints and floats. + See Also + -------- + Timestamp : Represents a single timestamp in time. + TimedeltaIndex : Immutable Index of timedelta64 data. + DateOffset : Standard kind of date increment used for a date range. + to_timedelta : Convert argument to timedelta. + datetime.timedelta : Represents a duration in the datetime module. + numpy.timedelta64 : Represents a duration compatible with NumPy. + Notes ----- The constructor may take in either both values of value and unit or From 1f60f3548124b991e97ec863e8cd5bec1da3b7de Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Sun, 19 May 2024 12:33:27 +0530 Subject: [PATCH 2/2] DOC: fix SA01, PR07 --- ci/code_checks.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c21b06f0dc355..fec143744e32f 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -228,9 +228,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timedelta.components SA01" \ -i "pandas.Timedelta.days SA01" \ -i "pandas.Timedelta.floor SA01" \ - -i "pandas.Timedelta.max PR02,PR07,SA01" \ - -i "pandas.Timedelta.min PR02,PR07,SA01" \ - -i "pandas.Timedelta.resolution PR02,PR07,SA01" \ + -i "pandas.Timedelta.max PR02" \ + -i "pandas.Timedelta.min PR02" \ + -i "pandas.Timedelta.resolution PR02" \ -i "pandas.Timedelta.round SA01" \ -i "pandas.Timedelta.to_numpy PR01" \ -i "pandas.Timedelta.to_timedelta64 SA01" \ @@ -263,7 +263,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timestamp.now SA01" \ -i "pandas.Timestamp.quarter SA01" \ -i "pandas.Timestamp.replace PR07,SA01" \ - -i "pandas.Timestamp.resolution PR02,PR07,SA01" \ + -i "pandas.Timestamp.resolution PR02" \ -i "pandas.Timestamp.second GL08" \ -i "pandas.Timestamp.strptime PR01,SA01" \ -i "pandas.Timestamp.time SA01" \