Skip to content
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

~Finish Collecting Arithmetic Tests #22350

Closed
wants to merge 10 commits into from

Conversation

jbrockmendel
Copy link
Member

De-duplicate fixtures and put nearly all of them in conftest

@gfyoung gfyoung added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite labels Aug 15, 2018
ids=lambda x: type(x).__name__)
def idx(request):
return request.param


@pytest.fixture
def tdser():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps td_series ? At least an underscore between td and ser would be good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will do.

@codecov
Copy link

codecov bot commented Aug 15, 2018

Codecov Report

Merging #22350 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22350   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         169      169           
  Lines       50787    50787           
=======================================
  Hits        46745    46745           
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.45% <ø> (ø) ⬆️
#single 42.29% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98fb53c...25ed1e8. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments on the fixture names. Also want to ensure that individual test files are completely obvious to what they are testing, so may want to add a level of nesting as things grow longer.

@pytest.fixture(params=[np.timedelta64(365, 'D'),
pd.Timedelta(365).to_pytimedelta(),
pd.Timedelta(days=365)] + _common_mismatch)
def mismatched(request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this more descriptive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring doesn't get the job done?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, prefer this to be a more descriptive name

@pytest.fixture(params=[pd.Timedelta(minutes=30).to_pytimedelta(),
np.timedelta64(30, 's'),
pd.Timedelta(seconds=30)] + _common_mismatch)
def not_hourly(request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add _fixture to these

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do this

@@ -712,6 +733,51 @@ def check(series, other):
check(tser, 5)


class TestUFuncCompat(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's think about putting these in a separate file (test_funcs)? (may want to make numeric a subdir, its already getting long).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give that some thought. Preference is to do quick turnarounds with small PRs here since there are lots of bugs to fix.

@jreback jreback added this to the 0.24.0 milestone Aug 16, 2018
@jreback
Copy link
Contributor

jreback commented Aug 23, 2018

can you rebase

@jbrockmendel
Copy link
Member Author

Rebased. After this the tests are pretty much all consolidated, so the next planned follow-up is to paramatrize/de-duplicate.

Also since#22390 just went in, upcoming PR to fix most of the outstanding xfails

@gfyoung
Copy link
Member

gfyoung commented Sep 3, 2018

@jbrockmendel : Have you addressed all of the comments here? I know you were waiting on @jreback to review this again, but at first glance, I can't tell if you have addressed everything he mentioned earlier.

@jbrockmendel
Copy link
Member Author

Have you addressed all of the comments here?

I think so, yes. But since this is a big enough PR that it is hard to keep track, I made #22559 as a subset of this in the hopes it would be easier in smaller pieces.

@gfyoung
Copy link
Member

gfyoung commented Sep 3, 2018

I think so, yes.

@jbrockmendel : What about this one here? Just double checking! 🙂

So should we be reviewing / merging this? Or should we go after #22559 first?

@jbrockmendel
Copy link
Member Author

What about this one here? Just double checking!

The suggestion on the fixture names was to stop fiddling for now and address in the next round. Since there were multiple comments about fixture names, its easy to lose track when one response is aimed at multiple comments.

So should we be reviewing / merging this? Or should we go after #22559 first?

Best case would be that everyone is happy here and #22559 is unnecessary. If this is going to be a slog, then I'd like to get #22559 in as this is a blocker for other work.

@gfyoung
Copy link
Member

gfyoung commented Sep 3, 2018

ping @jreback - could you review this again?

ids=lambda x: type(x).__name__)
def idx(request):
def numeric_index(request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you docstring

@pytest.fixture(params=[pd.Timedelta(minutes=30).to_pytimedelta(),
np.timedelta64(30, 's'),
pd.Timedelta(seconds=30)] + _common_mismatch)
def not_hourly(request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do this

@pytest.fixture(params=[np.timedelta64(365, 'D'),
pd.Timedelta(365).to_pytimedelta(),
pd.Timedelta(days=365)] + _common_mismatch)
def mismatched(request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, prefer this to be a more descriptive name

ts = pd.Timestamp.now()
df = pd.DataFrame({'x': range(5)})
with pytest.raises(TypeError):
df > ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented in another PR these should be in test_datetime

@jreback
Copy link
Contributor

jreback commented Sep 8, 2018

can you rebsae

@jbrockmendel
Copy link
Member Author

Closing in favor of #22645.

@jbrockmendel jbrockmendel deleted the arith_tests8 branch September 9, 2018 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants