Skip to content

TST: split up pandas/tests/test_resample.py #23872

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 19 commits into from
Nov 26, 2018

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Nov 23, 2018

@pep8speaks
Copy link

Hello @simonjayhawkins! Thanks for updating the PR.

@codecov
Copy link

codecov bot commented Nov 23, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23872   +/-   ##
=======================================
  Coverage   92.29%   92.29%           
=======================================
  Files         161      161           
  Lines       51500    51500           
=======================================
  Hits        47533    47533           
  Misses       3967     3967
Flag Coverage Δ
#multiple 90.69% <ø> (ø) ⬆️
#single 42.42% <ø> (ø) ⬆️

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 1f02bf2...fe2153e. Read the comment docs.

@jreback jreback added Testing pandas testing functions or related to the test suite Resample resample method labels Nov 23, 2018
from pandas.errors import AbstractMethodError

import pandas as pd
from pandas import DataFrame, Series
Copy link
Contributor

Choose a reason for hiding this comment

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

btw make sure you isort these new files and you may need to remove test_resample from setup.cfg

Copy link
Member Author

Choose a reason for hiding this comment

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

done

resample_methods = downsample_methods + upsample_methods + series_methods


def _simple_ts(start, end, freq='D'):
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 rename these to something more readable and add a doc-string

index = self.create_series().index[:0]
f = DataFrame(index=index)

for freq in ['M', 'D', 'H']:
Copy link
Contributor

Choose a reason for hiding this comment

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

in a future pass can parameterize things like this

Copy link
Member Author

Choose a reason for hiding this comment

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

OK

@@ -0,0 +1,65 @@
# pylint: disable=E1101

import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just name test_timedelta.py

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,739 @@
# pylint: disable=E1101

from datetime import datetime, timedelta
Copy link
Contributor

Choose a reason for hiding this comment

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

test_period is ok

@jreback
Copy link
Contributor

jreback commented Nov 23, 2018

i wouldn’t actually change the class structure / fixtures now
leave that for another pass

@simonjayhawkins
Copy link
Member Author

@jreback

i wouldn’t actually change the class structure / fixtures now
leave that for another pass

OK, i'll just rename _simple_ts etc and leave it at that?

i've changed the checklist from closes to precursor to

@jreback
Copy link
Contributor

jreback commented Nov 23, 2018

yeah a change like this is hard enough - first pass is just reorg minimally and rename

then can come back later and clean

@simonjayhawkins
Copy link
Member Author

@jreback The three files with the classes changed so far were not inheriting from the base class so the changes were relatively small. should i leave these changes in or revert those three commits?

@simonjayhawkins simonjayhawkins changed the title [WIP] TST: split up pandas/tests/test_resample.py TST: split up pandas/tests/test_resample.py Nov 23, 2018
@jreback jreback added this to the 0.24.0 milestone Nov 26, 2018
@jreback jreback merged commit dc3323e into pandas-dev:master Nov 26, 2018
@jreback
Copy link
Contributor

jreback commented Nov 26, 2018

thanks @simonjayhawkins nice split! sure happy to have a followup to address questions / simplify / use fixtures here

@simonjayhawkins simonjayhawkins deleted the split-resample-test branch November 26, 2018 19:49
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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