Example #1
0
def test_featurize_tsdata_object():
    """Test featurize TS data object function"""
    path_to_csv = pjoin(DATA_PATH, "dotastro_215153.dat")
    short_fname = featurize.shorten_fname(path_to_csv)
    custom_script_path = pjoin(cfg.UPLOAD_FOLDER, "testfeature1.py")
    fname_class_dict = {"dotastro_215153": "Mira"}
    features_to_use = ["std_err", "freq1_harmonics_freq_0"]
    all_feats = featurize.featurize_tsdata_object(
        path_to_csv, short_fname, custom_script_path, fname_class_dict,
        features_to_use)
    assert(isinstance(all_feats, dict))
    assert("std_err" in all_feats)
    assert("freq1_harmonics_freq_0" in all_feats)
Example #2
0
def test_shorten_fname():
    """Test shorten_fname."""
    npt.assert_equal(featurize.shorten_fname("path/to/filename.sfx"),
                     "filename")
    npt.assert_equal(featurize.shorten_fname("/home/path/abc.dat"), "abc")