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

Organize PeriodIndex tests #19641

Merged
merged 6 commits into from
Feb 11, 2018
Merged

Organize PeriodIndex tests #19641

merged 6 commits into from
Feb 11, 2018

Conversation

jbrockmendel
Copy link
Member

Crammed a lot of #19627 into this. Also did some new parametrization.

tm.assert_numpy_array_equal(per != base, exp)

exp = np.array([False, False, True, True])
tm.assert_numpy_array_equal(base > per, exp)
Copy link
Contributor

Choose a reason for hiding this comment

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

can u parametrize on Period and PI
and make errors in a separate test

Copy link
Member Author

Choose a reason for hiding this comment

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

Did some of this, leaving some of the parameterization for the next pass, since test_comp_nat is already a mess

Copy link
Member Author

Choose a reason for hiding this comment

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

This is turning out to be a PITA. Currently parametrizing other tests in the same file to earn goodwill.

result = Period('NaT', freq=freq) != idx1
tm.assert_numpy_array_equal(result, exp)

idx2 = PeriodIndex(['2011-02', '2011-01', '2011-04',
Copy link
Contributor

Choose a reason for hiding this comment

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

can u parametrize on Period and PI
would maybe be better to move Period tests (for this and above) to scalar tests

left = pd.PeriodIndex([pd.Period('2011-01-01'), pd.NaT,
pd.Period('2011-01-03')])
right = pd.PeriodIndex([pd.NaT, pd.NaT, pd.Period('2011-01-03')])

Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above

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

from pandas._libs.tslibs.frequencies import get_freq
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe period_freq

@jreback jreback added Testing pandas testing functions or related to the test suite Period Period data type labels Feb 10, 2018
@codecov
Copy link

codecov bot commented Feb 11, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19641      +/-   ##
==========================================
- Coverage   91.61%   91.59%   -0.03%     
==========================================
  Files         150      150              
  Lines       48807    48807              
==========================================
- Hits        44716    44704      -12     
- Misses       4091     4103      +12
Flag Coverage Δ
#multiple 89.96% <ø> (-0.03%) ⬇️
#single 41.73% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/plotting/_converter.py 65.22% <0%> (-1.74%) ⬇️

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 13bd008...0ac9789. Read the comment docs.

@jreback jreback added this to the 0.23.0 milestone Feb 11, 2018
@jreback
Copy link
Contributor

jreback commented Feb 11, 2018

ok pls do a parameterization / de-duplication pass next.

@jreback jreback merged commit 324379c into pandas-dev:master Feb 11, 2018
@jbrockmendel jbrockmendel deleted the itests7 branch February 11, 2018 21:37
harisbal pushed a commit to harisbal/pandas that referenced this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Period Period data type Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants