-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Organize PeriodIndex tests #19641
Conversation
tm.assert_numpy_array_equal(per != base, exp) | ||
|
||
exp = np.array([False, False, True, True]) | ||
tm.assert_numpy_array_equal(base > per, exp) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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')]) | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe period_freq
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
ok pls do a parameterization / de-duplication pass next. |
Crammed a lot of #19627 into this. Also did some new parametrization.