Skip to content

"TODO: ... remove this code" #4358

Closed
Closed

Description

@jbrockmendel

test_arima has a bunch of commented-out code, including:

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/tests/test_arima.py#L1016

    # raises - start out of sample
    # TODO: start out of sample is now allowed; remove this code
    # assert_raises(ValueError, model._get_prediction_index, *(204, None, True))
    # assert_raises(ValueError, model._get_prediction_index, *(204, None, False))
    # assert_raises(ValueError, model._get_prediction_index, *('2010Q1', None, True))
    # assert_raises(ValueError, model._get_prediction_index, *('2010Q1', None, False))

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/tests/test_arima.py#L940

    # raises - start out of sample
    # TODO: remove these, start out of sample now allowed
    # assert_raises(ValueError, model._get_prediction_index, *(311, None, True))
    # assert_raises(ValueError, model._get_prediction_index, *(311, None, False))
    # assert_raises(ValueError, model._get_prediction_index, *('2010', None, True))
    # assert_raises(ValueError, model._get_prediction_index, *('2010', None, False))

Any reason to keep any of this?

Also, whats the deal with all of these (and several more similar blocks):

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/tests/test_arima.py#L1323

    #NOTE: should raise
    #start, end = 1,3
    #fv = res1.model.predict(params, start, end)
    ## start < p, end 0 1959q3 - 1960q1
    #start, end = 2, 4
    #fv = res1.model.predict(params, start, end)
    ## start < p, end >0 1959q3 - 1971q4
    #start, end = 2, 51
    #fv = res1.model.predict(params, start, end)
    ## start < p, end nobs 1959q3 - 2009q3
    #start, end = 2, 202
    #fv = res1.model.predict(params, start, end)
    ## start < p, end >nobs 1959q3 - 2015q4
    #start, end = 2, 227
    #fv = res1.model.predict(params, start, end)

Activity

  1. josef-pkt commented on Mar 19, 2018

    @josef-pkt
    Member

    The assert_raises blocks can be deleted, AFAICS. The seem to be obsolete based on the comment.

    I don't know about the last part, but I wouldn't delete them without checking, i.e. What is the current behavior for those cases? and if there is something wrong, Do we have an open issue?
    I have no idea without running the commented out code.

    That is, you can run those example cases and check that they work correctly.

  2. jbrockmendel commented on Mar 19, 2018

    @jbrockmendel
    ContributorAuthor

    Most of the NOTE: should raise blocks do in fact raise. One block does not. It is not commented-out right now, so its just the comment that is out of place.

    https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/tests/test_arima.py#L1447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions