This repository was archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Correction doc for some Series.str methods #462
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @overload_method(StringMethodsType, 'istitle') | ||
| def hpat_pandas_stringmethods_istitle(self): | ||
| """ | ||
| hpat_pandas_series_str_is_docstring_tmpl = """ |
Contributor
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 better to name it "sdc_pandas_series_str_docstring_template"
| Pandas Series method :meth:`pandas.core.strings.StringMethods.isalnum()` implementation. | ||
|
|
||
| Note: Unicode type of list elements are supported only. Numpy.NaN is not supported as elements. | ||
| hpat_pandas_stringmethods_istitle.__doc__ = hpat_pandas_series_str_is_docstring_tmpl.format(**{ |
Contributor
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 it's better to do this for all function in a single loop, iterating over keys, values of a dict like:
stringmethods_funcs = {
'istitle': hpat_pandas_stringmethods_istitle,
...
}
And then:
for name, method in stringmethods_funcs.items():
stringmethods_funcs[name].__doc__ = sdc_pandas_series_str_docstring_template.format(**{name})
Contributor
kozlov-alexey
left a comment
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.
Looks good, but I think filling the doc attributes can be done in a loop.
densmirn
reviewed
Dec 31, 2019
densmirn
approved these changes
Jan 4, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.