class_docstr: Test singletask/multitask data loading.
docstr: Check can re-use featurization for multiple task selections.
      
code: def test_multiload(self):
      """Check can re-use featurization for multiple task selections."""
      # Only for debug!
      np.random.seed(123)
  
      current_dir = os.path.dirname(os.path.realpath(__file__))
      # Make directories to store the raw and featurized datasets.
      data_dir = tempfile.mkdtemp()
  
      # Load dataset
      logger.info("About to load dataset.")
      dataset_file = os.path.join(
          current_dir, "../../models/tests/assets/multitask_example.csv"
      )
  
      # Featurize tox21 dataset
      logger.info("About to featurize dataset.")
      featurizer = dc.feat.CircularFingerprint(size=1024)
      all_tasks = ["task%d" % i for i in range(17)]
  
      # featurization
      loader = dc.data.CSVLoader(
          tasks=all_tasks, feature_field="smiles", featurizer=featurizer
      )
      dataset = loader.create_dataset(dataset_file, data_dir)
  
      # train/valid split.
      _, y_multi, w_multi, _ = (
          dataset.X,
          dataset.y,
          dataset.w,
          dataset.ids,
      )
  
      # singletask load
      (
          y_tasks,
          w_tasks,
      ) = (
          [],
          [],
      )
      dataset = dc.data.DiskDataset(data_dir)
      for ind, task in enumerate(all_tasks):
          logger.info("Processing task %s" % task)
  
          _, y_task, w_task, _ = (
              dataset.X,
              dataset.y,
              dataset.w,
              dataset.ids,
          )
          y_tasks.append(y_task[:, ind])
          w_tasks.append(w_task[:, ind])
  
      # comparison
      for ind, task in enumerate(all_tasks):
          y_multi_task = y_multi[:, ind]
          w_multi_task = w_multi[:, ind]
  
          y_task = y_tasks[ind]
          w_task = w_tasks[ind]
  
          np.testing.assert_allclose(
              y_multi_task.flatten(), y_task.flatten()
          )
          np.testing.assert_allclose(
              w_multi_task.flatten(), w_task.flatten()
          )
  
file_path: deepchem/deepchem/data/tests/test_load.py
imports: import os
  import shutil
  import logging
  import unittest
  import tempfile
  import deepchem
  import numpy
label_desc: Use image node_id 2 for calling the TestLoad obj's underlying member method code with example usage: obj.test_multiload() without return types