-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Enhanced the documentation and added examples in pandas tseries offsets Week class #50732
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
Enhanced the documentation and added examples in pandas tseries offsets Week class #50732
Conversation
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.
thanks for your pr
got some comments, also there's a merge conflict
pandas/_libs/tslibs/offsets.pyx
Outdated
Weekly offset. | ||
Weekly offset. |
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.
please don't change the indendation
pandas/_libs/tslibs/offsets.pyx
Outdated
## Below examples explain the usage of this object. | ||
## Importing modules | ||
import pandas as pd |
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 don't think this is necessary, can you try without?
pandas/_libs/tslibs/offsets.pyx
Outdated
date_format = "%Y-%m-%d" | ||
date_object = pd.to_datetime("2023-01-13",format = date_format) | ||
print(date_object) | ||
## 2023-01-13 00:00:00 |
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.
this isn't how we write examples, please check https://pandas.pydata.org/docs/development/contributing_docstring.html
Hey @MarcoGorelli , thanks for the feedback!, I have made the changes you suggested. Please review. |
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.
can you check this passes https://pandas.pydata.org/docs/development/contributing_documentation.html#updating-a-pandas-docstring please?
b373e75
to
e99a1ec
Compare
Hey @MarcoGorelli, i passed the validation locally and pushed the changes. Please check. |
pandas/_libs/tslibs/offsets.pyx
Outdated
--------- | ||
>>> date_format = "%Y-%m-%d" | ||
>>> date_object = pd.to_datetime("2023-01-13",format = date_format) | ||
>>> print(date_object) |
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.
you don't need print
, just something like
>>> date_object
'2023-01-13 00:00:00'
(I haven't tried running this, so it may not be exactly correct)
Done the changes, please review. |
Hello @MarcoGorelli , is this good to merge or anything else is needed from my end? |
@akshay-babbar a couple of CI jobs are failing, you'll need to fix them up before this can be merged |
@MarcoGorelli Atleast one of the two errors is due to the docstring validation which you said can be ignored, for the other pre commit can you please guide me what to do?, cause from my end the code looks just fine. |
you need to address:
and
|
I have made and pushed the changes @MarcoGorelli , thanks for the help. :) |
doesn't look like CI started, could you add another commit (or merge upstream/main) to start it again? EDIT: I've done this, no need to do anything. this is probably good |
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.
this is close 💪
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.
just noticed, I think the underscores need to be the same length as the title
could you please also build this docstring locally and screenshot it and check it looks alright?
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.
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.
that's not the rendered docstring, see https://pandas.pydata.org/docs/dev/development/contributing_documentation.html#building-the-documentation for how to build it
something like
cd doc
python make.py clean && python make.py --single pandas.tseries.offsets.Week
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.
nice, looks like it renders fine anyway merging then, thanks @akshay-babbar ! |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.