Skip to content

DOC: Make _field_accessor manage the docstring format #24099

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 2 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def f(self):
return result

f.__name__ = name
f.__doc__ = docstring
f.__doc__ = "\n{}\n".format(docstring)
return property(f)


Expand Down Expand Up @@ -1129,12 +1129,12 @@ def date(self):
"The name of day in a week (ex: Friday)\n\n.. deprecated:: 0.23.0")

dayofyear = _field_accessor('dayofyear', 'doy',
"\nThe ordinal day of the year\n")
quarter = _field_accessor('quarter', 'q', "\nThe quarter of the date\n")
"The ordinal day of the year.")
quarter = _field_accessor('quarter', 'q', "The quarter of the date.")
days_in_month = _field_accessor(
'days_in_month',
'dim',
"\nThe number of days in the month\n")
"The number of days in the month.")
daysinmonth = days_in_month
_is_month_doc = """
Indicates whether the date is the {first_or_last} day of the month.
Expand Down
16 changes: 8 additions & 8 deletions pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def f(self):
return result

f.__name__ = name
f.__doc__ = docstring
f.__doc__ = "\n{}\n".format(docstring)
return property(f)


Expand Down Expand Up @@ -684,16 +684,16 @@ def to_pytimedelta(self):
return tslibs.ints_to_pytimedelta(self.asi8)

days = _field_accessor("days", "days",
"\nNumber of days for each element.\n")
"Number of days for each element.")
seconds = _field_accessor("seconds", "seconds",
"\nNumber of seconds (>= 0 and less than 1 day) "
"for each element.\n")
"Number of seconds (>= 0 and less than 1 day) "
"for each element.")
microseconds = _field_accessor("microseconds", "microseconds",
"\nNumber of microseconds (>= 0 and less "
"than 1 second) for each element.\n")
"Number of microseconds (>= 0 and less "
"than 1 second) for each element.")
nanoseconds = _field_accessor("nanoseconds", "nanoseconds",
"\nNumber of nanoseconds (>= 0 and less "
"than 1 microsecond) for each element.\n")
"Number of nanoseconds (>= 0 and less "
"than 1 microsecond) for each element.")

@property
def components(self):
Expand Down