0590c3656806d750e18a3085368d4edaf565952a,deepchem/data/tests/test_shape.py,,test_disk_dataset_get_legacy_shape_single_shard,#,67

Before Change


  num_features = 10
  num_tasks = 10
  // Generate data
  X = np.random.rand(num_datapoints, num_features)
  y = np.random.randint(2, size=(num_datapoints, num_tasks))
  w = np.random.randint(2, size=(num_datapoints, num_tasks))
  ids = np.array(["id"] * num_datapoints)

  dataset = dc.data.DiskDataset.from_numpy(X, y, w, ids, legacy_metadata=True)

  X_shape, y_shape, w_shape, ids_shape = dataset.get_shape()
  assert X_shape == X.shape
  assert y_shape == y.shape

After Change


  num_features = 10
  num_tasks = 10

  current_dir = os.path.dirname(os.path.abspath(__file__))
  // legacy_dataset is a dataset in the legacy format kept around for testing
  // purposes.
  data_dir = os.path.join(current_dir, "legacy_dataset")
  dataset = dc.data.DiskDataset(data_dir)

  X_shape, y_shape, w_shape, ids_shape = dataset.get_shape()
  assert X_shape == (num_datapoints, num_features)
  assert y_shape == (num_datapoints, num_tasks)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 27

Instances


Project Name: deepchem/deepchem
Commit Name: 0590c3656806d750e18a3085368d4edaf565952a
Time: 2020-08-13
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/data/tests/test_shape.py
Class Name:
Method Name: test_disk_dataset_get_legacy_shape_single_shard


Project Name: deepchem/deepchem
Commit Name: 303e3983b998ec2037a21f59aac932dddd834e75
Time: 2020-08-13
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/data/tests/test_legacy.py
Class Name:
Method Name: test_reshard


Project Name: deepchem/deepchem
Commit Name: 303e3983b998ec2037a21f59aac932dddd834e75
Time: 2020-08-13
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/data/tests/test_legacy.py
Class Name:
Method Name: test_make_legacy_dataset_from_numpy


Project Name: deepchem/deepchem
Commit Name: 0590c3656806d750e18a3085368d4edaf565952a
Time: 2020-08-13
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/data/tests/test_shape.py
Class Name:
Method Name: test_disk_dataset_get_legacy_shape_multishard


Project Name: deepchem/deepchem
Commit Name: 0590c3656806d750e18a3085368d4edaf565952a
Time: 2020-08-13
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/data/tests/test_shape.py
Class Name:
Method Name: test_disk_dataset_get_legacy_shape_single_shard