Skip to content

DOC: Fixed all remaining GL02 documentation errors and added appropriate check in CI #43003

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 8 commits into from
Aug 19, 2021
Merged
4 changes: 2 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03
MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi
Expand Down
16 changes: 14 additions & 2 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,20 @@ class NaTType(_NaT):
# These are the ones that can get their docstrings from datetime.

# nan methods
weekday = _make_nan_func("weekday", datetime.weekday.__doc__)
isoweekday = _make_nan_func("isoweekday", datetime.isoweekday.__doc__)
weekday = _make_nan_func(
"weekday",
"""
Return the day of the week represented by the date.
Monday == 0 ... Sunday == 6.
""",
)
isoweekday = _make_nan_func(
"isoweekday",
"""
Return the day of the week represented by the date.
Monday == 1 ... Sunday == 7.
""",
)
total_seconds = _make_nan_func("total_seconds", timedelta.total_seconds.__doc__)
month_name = _make_nan_func(
"month_name",
Expand Down
14 changes: 14 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,20 @@ default 'raise'
self.nanosecond / 3600.0 / 1e+9
) / 24.0)

def isoweekday(self):
"""
Return the day of the week represented by the date.
Monday == 1 ... Sunday == 7.
"""
return super().isoweekday()

def weekday(self):
"""
Return the day of the week represented by the date.
Monday == 0 ... Sunday == 6.
"""
return super().weekday()


# Aliases
Timestamp.weekofyear = Timestamp.week
Expand Down