1ead4fe94cc00561467641317befbc26a594933a,pmdarima/arima/tests/test_arima.py,,test_more_elaborate,#,398

Before Change


    // pickle this for the __get/setattr__ coverage.
    // since the only time this is tested is in parallel in auto.py,
    // this doesn"t actually get any coverage proof...
    fl = "some_temp_file.pkl"
    with open(fl, "wb") as p:
        pickle.dump(arima, p)

    // show we can predict with this even though it"s been pickled
    new_xreg = rs.rand(5, 4)
    _preds = arima.predict(n_periods=5, exogenous=new_xreg)

    // now unpickle
    with open(fl, "rb") as p:
        other = pickle.load(p)

    // show we can still predict, compare
    _other_preds = other.predict(n_periods=5, exogenous=new_xreg)
    assert_array_almost_equal(_preds, _other_preds)

    // now remove the pickle file
    os.unlink(fl)

    // now show that since we fit the ARIMA with an exogenous array,
    // we need to provide one for predictions otherwise it breaks.
    with pytest.raises(ValueError):

After Change


        y=hr, exogenous=xreg)
    _try_get_attrs(arima)

    with tempfile.TemporaryDirectory() as tdir:

        // pickle this for the __get/setattr__ coverage.
        // since the only time this is tested is in parallel in auto.py,
        // this doesn"t actually get any coverage proof...
        fl = os.path.join(tdir, "some_temp_file.pkl")
        with open(fl, "wb") as p:
            pickle.dump(arima, p)

        // show we can predict with this even though it"s been pickled
        new_xreg = rs.rand(5, 4)
        _preds = arima.predict(n_periods=5, exogenous=new_xreg)

        // now unpickle
        with open(fl, "rb") as p:
            other = pickle.load(p)

        // show we can still predict, compare
        _other_preds = other.predict(n_periods=5, exogenous=new_xreg)
        assert_array_almost_equal(_preds, _other_preds)

    // now show that since we fit the ARIMA with an exogenous array,
    // we need to provide one for predictions otherwise it breaks.
    with pytest.raises(ValueError):
        arima.predict(n_periods=5, exogenous=None)

    // show that if we DO provide an exogenous and it"s the wrong dims, we
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tgsmith61591/pmdarima
Commit Name: 1ead4fe94cc00561467641317befbc26a594933a
Time: 2020-07-13
Author: tgsmith61591@gmail.com
File Name: pmdarima/arima/tests/test_arima.py
Class Name:
Method Name: test_more_elaborate


Project Name: nipy/dipy
Commit Name: 99fcc31a804f09edc88af884c4d1e5f036b6f751
Time: 2018-02-15
Author: kumarashutosh.ee@gmail.com
File Name: dipy/io/tests/test_io_gradients.py
Class Name:
Method Name: test_read_bvals_bvecs


Project Name: scikit-optimize/scikit-optimize
Commit Name: 44be9703a0744caf78b8b61319be0db281e91d6a
Time: 2018-04-06
Author: scott_graham@bose.com
File Name: skopt/tests/test_space.py
Class Name:
Method Name: test_space_from_yaml