-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
move a small set of non-scalar tests out of scalar.test_timestamp #18377
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
Conversation
@@ -20,6 +21,61 @@ | |||
START, END = datetime(2009, 1, 1), datetime(2010, 1, 1) | |||
|
|||
|
|||
class TestTimestampEquivDateRange(object): |
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 class was previously at the bottom of test_timestamp.
|
||
from pandas.util.testing import assert_almost_equal | ||
|
||
randn = np.random.randn | ||
|
||
|
||
class TestDatetimeIndexLikeTimestamp(object): | ||
# Tests for DatetimeIndex behaving like a vectorized Timestamp |
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.
I really like the vectorized-timestamp abstraction. It might make sense to have parallel test classes for Timestamp methods and their DatetimeIndex counterparts.
Codecov Report
@@ Coverage Diff @@
## master #18377 +/- ##
===========================================
+ Coverage 39.61% 91.34% +51.73%
===========================================
Files 164 164
Lines 49799 49733 -66
===========================================
+ Hits 19728 45430 +25702
+ Misses 30071 4303 -25768
Continue to review full report at Codecov.
|
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.
small comment. ping when pushed / green.
pandas/tests/frame/test_indexing.py
Outdated
data = DataFrame(columns=columns, index=index) | ||
t = datetime(2012, 11, 1) | ||
ts = Timestamp(t) | ||
data[ts] = np.nan # works |
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 you add a comparison here
Ping |
thanks! |
Taking over from #18142 where scope got out of hand.
This PR is part of a series intended to separate non-scalar tests out of
tests.scalars
.