-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
TST: fixturize series/test_alter_axes.py #22526
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22526 +/- ##
==========================================
+ Coverage 92.04% 92.04% +<.01%
==========================================
Files 169 169
Lines 50782 50782
==========================================
+ Hits 46742 46744 +2
+ Misses 4040 4038 -2
Continue to review full report at Codecov.
|
|
||
class TestSeriesAlterAxes(): |
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.
inherit from object as more explicit
from pandas import Series | ||
|
||
|
||
@pytest.fixture |
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 add doc-strings and meaningful names for these. (e.g. ts -> datetime_series)
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.
Not sure what docstrings you imagine. Something like """A datetime series"""?
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.
see pandas/conftest.py for examples, yes that might be ok, the point is new features need a doc-string
pandas/tests/series/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def series(): |
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.
string_series
pandas/tests/series/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def objSeries(): |
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.
object_series
pandas/tests/series/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def empty(): |
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.
empty_series
This is the same issue as in #22236 - these "fixture-like" One possible approach to satisfy both demands would be to open up a sister issue to #22471 for Series, and have a "translation guide" like
The same approach could be applied to #22236 / #22471 if you're unhappy with the fixture names coming from |
I added the "translations" as requested - it's gonna make transitioning the other modules a fair bit harder, but for only four fixtures, I think it's doable. |
39b251d
to
38afdfd
Compare
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.
doc comments, ping on green.
from pandas import Series | ||
|
||
|
||
@pytest.fixture |
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.
see pandas/conftest.py for examples, yes that might be ok, the point is new features need a doc-string
Hello @h-vetinari! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on August 31, 2018 at 13:49 Hours UTC |
49a91c6
to
c917d81
Compare
All green. This is very similar to #22236 - can I please ask you to take a look there again? I incorporated all your feedback (fixturize, split off warnings into new PR, etc.), and don't know what's left to do - it's been a very drawn-out process to eke out further instructions for what could have been a simple test clean-up. Based on this review here, I now also added docstrings to the fixtures there; I didn't rename them yet (but added a note in each fixture), because otherwise the fixturization of the other modules would be that much harder (and it's much easier to run a simple search and replace once everything is translated, i.e. #22471 is done). |
it’s long and drawn out because the PRs have too much unrelated changes in them 1 thing per PR will get u merged much faster with less comments even things as simple as changing unrelated whatsnew notes the more code the more i have to go over with a fine toothed comb further responding to my comments with further questions - while for sure ask if things are unclear |
For sure, and I appreciate the effort you put in. But I've learned my lesson about the unrelated changes, and I've been splitting them into smaller and smaller pieces. In #22236, the "unrelated" changes were - respectfully - mostly your requests at cleaning up things not directly related to the PR (except that it was in the same module), and I split off the new warnings as requested as well. The diffs of the last few commits are not very large at all (except the added docstrings now, which I'll happily revert if not necessary) - e.g. starting after your last 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.
small comments ping on green.
@h-vetinari the pings are fine, but if someone wants to work on things based on this nothing is stopping them, they can rebase off of this PR, this is a quite common workflow. This will be merged after all comments are satisfied. Pls be patient. We have a tremendous amount of PRs
pandas/tests/series/conftest.py
Outdated
""" | ||
Fixture for Series of floats with DatetimeIndex | ||
|
||
See pandas.util.testing.makeTimeSeries |
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 these See .. comments make sense here, just keep the summary line.
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.
Removed those comments
Yeah, I get there's lots of traffic. I mentioned this because this PR was basically finished and it's not a "beginner workflow" to rebase off an open PR. |
a355f5f
to
4270363
Compare
ping on green |
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
In particular, it takes the fixture-like attributes of
tests/series/common.TestData
and transforms them into fixtures intests/series/conftest.py
, with the eventual goal of replacing all theTestData
-attributes in the Series tests, similar to #22471 (I can also open a sister issue to that for the Series tests).