Skip to content

BUG: TSA models if date index without known frequency - #3113

Merged
ChadFulton merged 9 commits into
statsmodels:masterfrom
ChadFulton:gh-3068
Sep 21, 2016
Merged

ChadFulton merged 9 commits into
statsmodels:masterfrom
ChadFulton:gh-3068

Conversation

@ChadFulton

Copy link
Copy Markdown
Member

Closes #3068.

Puts a shim in to allow correctly creating the DatetimeIndex in the nanosecond case.

@coveralls

coveralls commented Jul 16, 2016 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.003%) to 88.811% when pulling 2fcfbc8 on ChadFulton:gh-3068 into f86c074 on statsmodels:master.

@ChadFulton

Copy link
Copy Markdown
Member Author

The underlying issue is now fixed in Pandas (pandas-dev/pandas#13672), but the shim is probably still necessary.

from pandas import version
if version.version < '0.14':
raise NotImplementedError('Nanosecond index not available in'
' Pandas < 0.14')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This looks kind of like a hack, but I have not been able to find a simple way to test for the presence of the nanosecond bug itself. if anyone has a better way, that would be great.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.02%) to 89.238% when pulling 539c006 on ChadFulton:gh-3068 into bb1db2b on statsmodels:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.02%) to 89.242% when pulling 4fd85c4 on ChadFulton:gh-3068 into bb1db2b on statsmodels:master.

@ChadFulton

Copy link
Copy Markdown
Member Author

I think this is going to come back green (and backport version too hopefully), in which case I'm ready to merge.

Note: coverage has to decrease here, because some of the new lines are not accessible when pandas < 0.14, and the coverage machine is pandas == 0.13.

It would be good for someone else to take a quick look (it's only a few lines of code) to make sure that I'm not relying on something (like pd.__version__) that I shouldn't be relying on. @josef-pkt @kshedden ?

@ChadFulton

Copy link
Copy Markdown
Member Author

I'm looking forward to getting this PR done :) so I will merge this and its backport (#3175) tomorrow unless there are concerns.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.02%) to 89.253% when pulling 7829e03 on ChadFulton:gh-3068 into f5c3d36 on statsmodels:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.02%) to 89.254% when pulling 5839ee1 on ChadFulton:gh-3068 into f5c3d36 on statsmodels:master.

@ChadFulton

Copy link
Copy Markdown
Member Author

I changed the code to use distutils.version.LooseVersion, so now it mirrors pandas' usage of version checking. Since there are no concerns, I will merge this and the backport. Nanoseconds should either work now where supported, or else give a meaningful error message.

@ChadFulton
ChadFulton merged commit 03158f2 into statsmodels:master Sep 21, 2016
@ChadFulton
ChadFulton deleted the gh-3068 branch September 21, 2016 13:57
This was referenced Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants