Skip to content

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

Merged
merged 3 commits into from
Nov 22, 2017

Conversation

jbrockmendel
Copy link
Member

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.

@@ -20,6 +21,61 @@
START, END = datetime(2009, 1, 1), datetime(2010, 1, 1)


class TestTimestampEquivDateRange(object):
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 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
Copy link
Member Author

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
Copy link

codecov bot commented Nov 20, 2017

Codecov Report

Merging #18377 into master will increase coverage by 51.73%.
The diff coverage is n/a.

Impacted file tree graph

@@             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
Flag Coverage Δ
#multiple 89.14% <ø> (?)
#single 39.62% <ø> (+0.01%) ⬆️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/computation/pytables.py 92.37% <0%> (+0.3%) ⬆️
pandas/io/pytables.py 92.84% <0%> (+0.97%) ⬆️
pandas/core/config_init.py 98.34% <0%> (+4.95%) ⬆️
pandas/io/formats/console.py 69.69% <0%> (+6.06%) ⬆️
pandas/compat/__init__.py 58.1% <0%> (+8.1%) ⬆️
pandas/core/reshape/util.py 90.32% <0%> (+12.9%) ⬆️
pandas/core/computation/common.py 85.71% <0%> (+14.28%) ⬆️
pandas/compat/numpy/__init__.py 93.93% <0%> (+18.18%) ⬆️
pandas/core/indexes/api.py 98.78% <0%> (+19.51%) ⬆️
... and 113 more

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 1915ffc...e9d1822. Read the comment docs.

@jreback jreback added the Testing pandas testing functions or related to the test suite label Nov 20, 2017
@jreback jreback added this to the 0.22.0 milestone Nov 20, 2017
Copy link
Contributor

@jreback jreback left a 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.

data = DataFrame(columns=columns, index=index)
t = datetime(2012, 11, 1)
ts = Timestamp(t)
data[ts] = np.nan # works
Copy link
Contributor

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

@jbrockmendel
Copy link
Member Author

Ping

@jreback jreback merged commit 6ac7f78 into pandas-dev:master Nov 22, 2017
@jreback
Copy link
Contributor

jreback commented Nov 22, 2017

thanks!

@jbrockmendel jbrockmendel deleted the scalard_idx2 branch December 8, 2017 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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