-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Timestamp EX01 errors #37904
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
DOC: Timestamp EX01 errors #37904
Conversation
…tcfromtimestamp, fromtimestamp, combine. Typos in ceil, round, floor corrected
From the checks, I believe that there are some docstrings that were not supposed to be changed? I am starting to contribute and trying to follow up on this #17327 |
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 a couple of comments. pls merge master and ping on green.
pandas/_libs/tslibs/timestamps.pyx
Outdated
Timestamp('2020-03-14 15:32:00') | ||
>>> ts.floor(freq='S') # seconds | ||
Timestamp('2020-03-14 15:32:52') | ||
>>> ts.floor(freq='L') # miliseconds |
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.
prob can show just a few rather than all
can you merge master and ping on green (to make sure no failures are real). |
Added few changes to pandas/_libs/tslibs/nattype.pyx so the docstrings match (this check is done by test attached below). Should pass the tests now, I'll ping you once the checks finish. pandas/pandas/tests/scalar/test_nat.py Line 326 in 456fcb9
|
@jreback changes reverted |
oh how is master passing now then? yeah this needs to be green. ok i guess re-revert. the only thing with the NaT tests is that they should be showing NaT int he examples |
Hi @jreback , pandas/pandas/tests/scalar/test_nat.py Line 326 in 456fcb9
Should we maybe change the test pandas/pandas/tests/scalar/test_nat.py in onther PR? |
ok instead let's use the same doc-string, BUT add a NaT example to it, this should make tests pass and make the examples useful. ping on green. |
Error in the following test from pandas/tests/io/test_gcs.py in Windows. Not sure what is causing it. pandas/pandas/tests/io/test_gcs.py Lines 83 to 119 in 5abc06f
|
On another note: Hi @jreback, thanks for your feedback. Let me summarize last commits below. 1)
|
@pytest.mark.parametrize( | |
"compare", | |
( | |
_get_overlap_public_nat_methods(Timestamp, True) | |
+ _get_overlap_public_nat_methods(Timedelta, True) | |
), | |
) | |
def test_nat_doc_strings(compare): | |
# see gh-17327 | |
# | |
# The docstrings for overlapping methods should match. | |
klass, method = compare | |
klass_doc = getattr(klass, method).__doc__ | |
nat_doc = getattr(NaT, method).__doc__ | |
assert klass_doc == nat_doc |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@lucasrodes i am ok prob merging this as is, if you can merge master and ping |
@lucasrodes this was close. if you can merge master and see if can get all passing. |
Sorry for the late reply @jreback. Will do asap |
@jreback merged with master |
pandas/_libs/tslibs/nattype.pyx
Outdated
Add 'Europe/Stockholm' as timezone: | ||
|
||
>>> ts.tz_localize(tz='Europe/Stockholm') | ||
Timestamp('2020-03-14 15:32:52.192548651+0100', tz='Europe/Stockholm' |
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.
Missing an ending )
Sorry for the long delay @lucasrodes . Looks mostly good. One comment otherwise LGTM |
@mroeschke Merged with upstream & fixed typos (missing '(' in docstring examples) |
Thanks @lucasrodes! Apologies for the long wait getting this one in. |
* SS01 errors fixed * trailing-whitespace error fixed * added coded to code_checks.sh script * fixed docstrings consistency * mistaken file * trailing-whitespace typo * Example section for ceil method * Added example section for ceil, floor and round * example section added to methods day_name, month_name, fromordinal, utcfromtimestamp, fromtimestamp, combine. Typos in ceil, round, floor corrected * trailing whitespace * typo in floor method * added example section for method normalize * typo * recommendations from pull request review * typo * revert changes. to be addressed in another PR * Added NaT examples in nattype and timestamp docstrings where needed. * trigger GitHub actions * added missing ( in docstring examples * added missing ( in docstring example Co-authored-by: lucasrodes <lucasrodesg@gmail.com>
* SS01 errors fixed * trailing-whitespace error fixed * added coded to code_checks.sh script * fixed docstrings consistency * mistaken file * trailing-whitespace typo * Example section for ceil method * Added example section for ceil, floor and round * example section added to methods day_name, month_name, fromordinal, utcfromtimestamp, fromtimestamp, combine. Typos in ceil, round, floor corrected * trailing whitespace * typo in floor method * added example section for method normalize * typo * recommendations from pull request review * typo * revert changes. to be addressed in another PR * Added NaT examples in nattype and timestamp docstrings where needed. * trigger GitHub actions * added missing ( in docstring examples * added missing ( in docstring example Co-authored-by: lucasrodes <lucasrodesg@gmail.com>
Example section added for several methods in class pd.Timestamp
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Examples added for: