Skip to content

TST/CLN: parametrize tests\resample\test_time_grouper.py #24013

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

Merged
merged 5 commits into from
Dec 3, 2018

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Nov 30, 2018

@pep8speaks
Copy link

Hello @simonjayhawkins! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #24013 into master will decrease coverage by 49.86%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24013       +/-   ##
===========================================
- Coverage   92.31%   42.44%   -49.87%     
===========================================
  Files         161      161               
  Lines       51562    51562               
===========================================
- Hits        47599    21886    -25713     
- Misses       3963    29676    +25713
Flag Coverage Δ
#multiple ?
#single 42.44% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-97.98%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-95.46%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.17%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.15%) ⬇️
pandas/core/tools/numeric.py 10.44% <0%> (-89.56%) ⬇️
... and 119 more

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 022f458...ed6a781. Read the comment docs.

@jreback jreback added Testing pandas testing functions or related to the test suite Resample resample method labels Nov 30, 2018
('prod', assert_frame_equal),
('var', assert_frame_equal),
('std', assert_frame_equal),
('mean', assert_frame_equal),
Copy link
Contributor

Choose a reason for hiding this comment

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

you could avoid the assert_func and just change it to do tm.assert_equal

('min', assert_frame_equal),
('max', assert_frame_equal),
('prod', assert_frame_equal),
('var', assert_frame_equal),
Copy link
Contributor

Choose a reason for hiding this comment

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

i think you could move all of the func to a fixture in pandas/tests/resample/conftest (might be usable elsewhere)

Copy link
Member Author

Choose a reason for hiding this comment

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

so that the fixture is reusable, std has been added to the downsample methods in test_base.py and sem, median, ohlc, quantile and nunique added to the test_aggregate_normal test, although ohlc fails.

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.

lgtm. lmk on that question.

@@ -0,0 +1,26 @@
import pytest

# The various methods we support
Copy link
Contributor

Choose a reason for hiding this comment

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

we might be able to move these to pandas/conftest IF they can also be used in groupby tests (but that would be in a future PR)

@@ -26,7 +26,7 @@

# The various methods we support
downsample_methods = ['min', 'max', 'first', 'last', 'sum', 'mean', 'sem',
'median', 'prod', 'var', 'ohlc', 'quantile']
'median', 'prod', 'var', 'std', 'ohlc', 'quantile']
upsample_methods = ['count', 'size']
Copy link
Contributor

Choose a reason for hiding this comment

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

are these still needed then? (as you have fixtures)

Copy link
Contributor

Choose a reason for hiding this comment

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

or these are needed by current methods, until we migrate all?

Copy link
Member Author

Choose a reason for hiding this comment

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

the other tests that use this are not yet parametrized. what i probably should have done was import the declarations into conftest.py to avoid duplication.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, if you want to push that change would be good

Copy link
Contributor

Choose a reason for hiding this comment

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

ping on green.

@jreback jreback added this to the 0.24.0 milestone Dec 3, 2018
@simonjayhawkins
Copy link
Member Author

@jreback green!

@jreback jreback merged commit 367efb2 into pandas-dev:master Dec 3, 2018
@jreback
Copy link
Contributor

jreback commented Dec 3, 2018

thanks @simonjayhawkins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resample resample method 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