Skip to content

TST: Timedelta tests reorg (gh14854) #15324

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

Closed
wants to merge 6 commits into from
Closed

TST: Timedelta tests reorg (gh14854) #15324

wants to merge 6 commits into from

Conversation

TrigonaMinima
Copy link

@TrigonaMinima TrigonaMinima commented Feb 6, 2017

@jreback jreback added Clean Testing pandas testing functions or related to the test suite labels Feb 6, 2017
@@ -0,0 +1,201 @@
from datetime import time, timedelta
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.

-> test_tools.py

@@ -6,27 +6,25 @@

"""

import numpy as np
from numpy.random import randn
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 move this to pandas/tests/scalar/test_period.py

Copy link
Author

Choose a reason for hiding this comment

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

This is a really big file (5k+ lines)

Still move it there?

Copy link
Contributor

Choose a reason for hiding this comment

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

sure can do in anthoher PR. I though you moved the PeriodIndex tests out already. But yes, certainly should split it.

@jreback
Copy link
Contributor

jreback commented Feb 6, 2017

@TrigonaMinima looks great!

just a couple of corrections.

@jreback
Copy link
Contributor

jreback commented Feb 6, 2017

pls add a whatsnew note as well (reorg of timeseries tests), you can put in other API changes section (in 0.20.0)

@jreback
Copy link
Contributor

jreback commented Feb 6, 2017

only thing left after this are the timeseries_legacy.py tests I think (but let's deal with them in a separate PR).

@jreback jreback added this to the 0.20.0 milestone Feb 6, 2017
@TrigonaMinima
Copy link
Author

I haven't finished the reorg of Period tests yet. Should I do it in this PR only?

@jreback
Copy link
Contributor

jreback commented Feb 6, 2017

@TrigonaMinima no, let's leave period for another.

from datetime import timedelta

import pandas as pd
from pandas.util import testing as tm
Copy link
Contributor

Choose a reason for hiding this comment

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

so you moved this (just fine).

@@ -1,467 +0,0 @@
# -*- coding: utf-8 -*-

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.

and removed all of this (again just fine). that's why I thought you were moving Period. But can certainly finish in another.

@TrigonaMinima
Copy link
Author

@jreback I tried by best, but there were still some confusions. So, could you please have somewhat deeper look at it. I'll correct the issues if there are any, tomorrow night.

@jreback
Copy link
Contributor

jreback commented Feb 6, 2017

what confusions?

@TrigonaMinima
Copy link
Author

  • Some coercion functions from tseries/test_tslib.py I moved to indexing/test_coercion.py.
  • _conversion and _format_converters functions (currently in scalar/test_timedelta.py) to be sent to scalar/test_timedelta or indexes/timedeltas?
  • test_timedelta_ops_scalar (currently in indexes/timedeltas/test_ops.py) in scalar/test_timedelta.py or indexes/timedeltas? Here I was confused because there were some arithmetic operations going on between Timedelta and Timestamp but it said scalar.
  • This function - test_add_overflow was under class TestSlicing (currently in tests/test_ops.py). Why was that? I almost placed it in test_partial_slicing.py.

@TrigonaMinima
Copy link
Author

Also, I want to understand the code of the core pandas library. Any suggestions on what should the starting point be?

@jreback
Copy link
Contributor

jreback commented Feb 6, 2017

ok i will have a look and see if anything needs moving

so best way to understand code is to:

debug or write a test, then step thru and see what it does

starting with a Series or DataFrame method is useful to see

@jreback
Copy link
Contributor

jreback commented Feb 7, 2017

@TrigonaMinima some flake errors.

I'll have a look at your points above when merging.

@codecov-io
Copy link

codecov-io commented Feb 7, 2017

Codecov Report

Merging #15324 into master will increase coverage by <.01%.

@@            Coverage Diff             @@
##           master   #15324      +/-   ##
==========================================
+ Coverage   86.32%   86.33%   +<.01%     
==========================================
  Files         141      141              
  Lines       51164    51164              
==========================================
+ Hits        44169    44170       +1     
+ Misses       6995     6994       -1
Impacted Files Coverage Δ
pandas/core/common.py 91.36% <ø> (+0.33%)

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 8d57450...b24b95d. Read the comment docs.

@@ -1260,3 +1263,61 @@ def test_replace_series_timedelta64(self):

def test_replace_series_period(self):
pass


class TestArrayToDatetime(tm.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

these go in: pandas/tests/datetimes/tests/test_tools.py

@TrigonaMinima
Copy link
Author

@jreback don't know what to do with this build/merge error.

I have fixed the merge conflicts. I am able to merge this branch to master without any conflicts on my local repo.

@jreback
Copy link
Contributor

jreback commented Feb 7, 2017

ok np i'll fix this up

@jreback
Copy link
Contributor

jreback commented Feb 7, 2017

https://github.com/pandas-dev/pandas/compare/master...jreback:TrigonaMinima-gh14854-timedelta?expand=1

is the compare, with a couple of changes from on top.

@TrigonaMinima really appreciate the PRs here! segregated tests that are not in huge files are awesome!

@jreback jreback mentioned this pull request Feb 8, 2017
4 tasks
@jreback jreback closed this in bf8194a Feb 8, 2017
@jreback
Copy link
Contributor

jreback commented Feb 8, 2017

@TrigonaMinima thanks again for this!

love for you to keep going (period tests!)

keep in mind we are switching to pytest very shortly (its should work similarly though).

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean 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