-
- Notifications
You must be signed in to change notification settings - Fork 19.2k
DOC: document subclasses in API docs with selection of specific methods/attributes #18202
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
Changes from all commits
500ab71 257fc8a d59c0b5 cb57504 5e4cf6d 346a73b b5902ff af1e866 874aefe 32c2816 38673bd e30335e 38efdcb 5e8bcbe 8695727 4476a5f a5005e1 aa92592 8841035 1527cdb 7ca3434 5a0e10e c8504d1 f7ed015 094f6f6 1c2160f 6e99be2 3bd03db ba257cc 169e833 f846713 141107a 3a224be 34834fa File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -282,6 +282,8 @@ class Timestamp(_Timestamp): | |
| @classmethod | ||
| def fromordinal(cls, ordinal, freq=None, tz=None, offset=None): | ||
| """ | ||
| Timestamp.fromordinal(ordinal, freq=None, tz=None, offset=None) | ||
| | ||
| passed an ordinal, translate and convert to a ts | ||
| note: by definition there cannot be any tz info on the ordinal itself | ||
| | ||
| | @@ -302,8 +304,10 @@ class Timestamp(_Timestamp): | |
| @classmethod | ||
| def now(cls, tz=None): | ||
| """ | ||
| Return the current time in the local timezone. Equivalent | ||
| to datetime.now([tz]) | ||
| Timestamp.now(tz=None) | ||
| | ||
| Returns new Timestamp object representing current time local to | ||
| tz. | ||
| | ||
| Parameters | ||
| ---------- | ||
| | @@ -317,6 +321,8 @@ class Timestamp(_Timestamp): | |
| @classmethod | ||
| def today(cls, tz=None): | ||
| """ | ||
| Timestamp.today(cls, tz=None) | ||
| | ||
| Return the current time in the local timezone. This differs | ||
| from datetime.today() in that it can be localized to a | ||
| passed timezone. | ||
| | @@ -330,18 +336,38 @@ class Timestamp(_Timestamp): | |
| | ||
| @classmethod | ||
| def utcnow(cls): | ||
| """ | ||
| Timestamp.utcnow() | ||
| | ||
| Return a new Timestamp representing UTC day and time. | ||
| """ | ||
| return cls.now('UTC') | ||
| | ||
| @classmethod | ||
| def utcfromtimestamp(cls, ts): | ||
| """ | ||
| Timestamp.utcfromtimestamp(ts) | ||
| | ||
| Construct a naive UTC datetime from a POSIX timestamp. | ||
| """ | ||
| return cls(datetime.utcfromtimestamp(ts)) | ||
| | ||
| @classmethod | ||
| def fromtimestamp(cls, ts): | ||
| """ | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sp? | ||
| Timestamp.fromtimestamp(ts) | ||
| | ||
| timestamp[, tz] -> tz's local time from POSIX timestamp. | ||
| """ | ||
| return cls(datetime.fromtimestamp(ts)) | ||
| | ||
| @classmethod | ||
| def combine(cls, date, time): | ||
| """ | ||
| Timsetamp.combine(date, time) | ||
| | ||
| date, time -> datetime with same date and time fields | ||
| """ | ||
| return cls(datetime.combine(date, time)) | ||
| | ||
| def __new__(cls, object ts_input=_no_input, | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -120,6 +120,15 @@ class CategoricalDtype(ExtensionDtype): | |
| Must be unique, and must not contain any nulls. | ||
| ordered : bool, default False | ||
| | ||
| Attributes | ||
| ---------- | ||
| categories | ||
| ordered | ||
| | ||
| Methods | ||
| ------- | ||
| None | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the problem that if you don't include this 'None', that it then automatically generated the 'Methods' section and thus included too much? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'm not sure how best to avoid that. This is where class-level | ||
| | ||
| Notes | ||
| ----- | ||
| This class is useful for specifying the type of a ``Categorical`` | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -121,6 +121,17 @@ class IntervalIndex(IntervalMixin, Index): | |
| Name to be stored in the index. | ||
| copy : boolean, default False | ||
| Copy the meta-data | ||
| mid | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, if it's just the attribute name the attribute docstring is filled in. But currently that's buggy because | ||
| values | ||
| is_non_overlapping_monotonic | ||
| | ||
| Methods | ||
| ------- | ||
| from_arrays | ||
| from_tuples | ||
| from_breaks | ||
| from_intervals | ||
| contains | ||
| | ||
| Examples | ||
| --------- | ||
| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is also some other code related to this hack that then could be removed (eg the place where I define the 'class_members_list' config). See cf40991 that added it