7f1bef0c8063b39c9d6713a0e3835eb17ea4a5b7,deepchem/datasets/tests/test_load.py,TestLoad,test_move_load,#TestLoad#,29

Before Change


    Test that datasets can be moved and loaded.
    verbosity = "high"
    current_dir = os.path.dirname(os.path.realpath(__file__))
    feature_dir = os.path.join(self.base_dir, "features")
    moved_feature_dir = os.path.join(self.base_dir, "moved_features")
    samples_dir = os.path.join(self.base_dir, "samples")
    moved_samples_dir = os.path.join(self.base_dir, "moved_samples")
    data_dir = os.path.join(self.base_dir, "data")
    moved_data_dir = os.path.join(self.base_dir, "moved_data")
    dataset_file = os.path.join(
        current_dir, "../../models/tests/example.csv")

    featurizers = [CircularFingerprint(size=1024)]
    tasks = ["log-solubility"]
    featurizer = DataFeaturizer(tasks=tasks,
                                smiles_field="smiles",
                                compound_featurizers=featurizers,
                                verbosity=verbosity)
    featurized_samples = featurizer.featurize(
        dataset_file, feature_dir,
        samples_dir, reload=reload)
    dataset = Dataset(data_dir=data_dir, samples=featurized_samples, 
                      featurizers=featurizers, tasks=tasks,
                      verbosity=verbosity, reload=reload)

    X, y, w, ids = dataset.to_numpy()
    shutil.move(feature_dir, moved_feature_dir)
    shutil.move(samples_dir, moved_samples_dir)

After Change


    X, y, w, ids = dataset.to_numpy()
    shutil.move(data_dir, moved_data_dir)

    moved_dataset = Dataset(
        moved_data_dir, reload=reload)

    X_moved, y_moved, w_moved, ids_moved = moved_dataset.to_numpy()

    np.testing.assert_allclose(X, X_moved)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: deepchem/deepchem
Commit Name: 7f1bef0c8063b39c9d6713a0e3835eb17ea4a5b7
Time: 2016-05-30
Author: bharath.ramsundar@gmail.com
File Name: deepchem/datasets/tests/test_load.py
Class Name: TestLoad
Method Name: test_move_load


Project Name: deepchem/deepchem
Commit Name: fe358db6913812c1e3ba8cd8036d941c996fb413
Time: 2016-05-31
Author: bharath.ramsundar@gmail.com
File Name: deepchem/datasets/pcba_datasets.py
Class Name:
Method Name: load_pcba


Project Name: deepchem/deepchem
Commit Name: fe358db6913812c1e3ba8cd8036d941c996fb413
Time: 2016-05-31
Author: bharath.ramsundar@gmail.com
File Name: deepchem/datasets/muv_datasets.py
Class Name:
Method Name: load_muv