Exemplo n.º 1
0
def test_load_smoke(gendf):
    df = gendf()

    engine = Engine(df, n_models=5, use_mp=False)
    engine.init_models()

    with tempfile.NamedTemporaryFile('wb') as tf:
        engine.save(tf.name)
        Engine.load(tf.name)
Exemplo n.º 2
0
def test_load_smoke(gendf):
    df = gendf()

    engine = Engine(df, n_models=5, use_mp=False)
    engine.init_models()

    with tempfile.NamedTemporaryFile('wb') as tf:
        engine.save(tf.name)
        Engine.load(tf.name)
Exemplo n.º 3
0
def test_save_and_load_equivalence(gendf):
    df = gendf()

    engine = Engine(df, n_models=5, use_mp=False)
    engine.init_models()

    with tempfile.NamedTemporaryFile('wb') as tf:
        engine.save(tf.name)
        new_engine = Engine.load(tf.name)

        assert engine._models == new_engine._models
        assert engine._dtypes == new_engine._dtypes
        assert engine._metadata == new_engine._metadata
        assert engine._converters == new_engine._converters
        assert engine._diagnostic_tables == new_engine._diagnostic_tables
        assert all(engine._row_names == new_engine._row_names)
        assert all(engine._col_names == new_engine._col_names)
Exemplo n.º 4
0
def test_save_and_load_equivalence(gendf):
    df = gendf()

    engine = Engine(df, n_models=5, use_mp=False)
    engine.init_models()

    with tempfile.NamedTemporaryFile('wb') as tf:
        engine.save(tf.name)
        new_engine = Engine.load(tf.name)

        assert engine._models == new_engine._models
        assert engine._dtypes == new_engine._dtypes
        assert engine._metadata == new_engine._metadata
        assert engine._converters == new_engine._converters
        assert engine._diagnostic_tables == new_engine._diagnostic_tables
        assert all(engine._row_names == new_engine._row_names)
        assert all(engine._col_names == new_engine._col_names)