(self)
return True
Build the dataset.
Build the dataset.
Build the dataset .
def build(self) -> bool:
    """Build the dataset."""
    if self.is_ready():
      logging.info("Dataset is ready.")
      return True
    logging.info('Dataset is not ready!')
    if not os.path.exists(self.project_dir):
      os.mkdir(self.project_dir)
    if not os.path.exists(self.data_dir):
      os.mkdir(self.data_dir)
    if not os.path.exists(self.config_dir):
      os.mkdir(self.config_dir)
    if not os.path.exists(self.download_dir):
      os.mkdir(self.download_dir)

    self.copy_config_files()
    if not self._download_ready():
      logging.info("Download not ready!")
      logging.info("Start downloading ...")
      download_res = self.download()
      if not download_res:
        logging.warning("Download failed.")
        return False
    logging.info("Start doing after download processing.")
    after_res = self.after_download()
    if not after_res:
      logging.warning("After download process failed.")
      return False
    logging.info("Dataset is ready.")
    return True
def build ( self ) -> bool : if self . is_ready ( ) : logging . info ( "Dataset is ready." ) return True logging . info ( 'Dataset is not ready!' ) if not os . path . exists ( self . project_dir ) : os . mkdir ( self . project_dir ) if not os . path . exists ( self . data_dir ) : os . mkdir ( self . data_dir ) if not os . path . exists ( self . config_dir ) : os . mkdir ( self . config_dir ) if not os . path . exists ( self . download_dir ) : os . mkdir ( self . download_dir ) self . copy_config_files ( ) if not self . _download_ready ( ) : logging . info ( "Download not ready!" ) logging . info ( "Start downloading ..." ) download_res = self . download ( ) if not download_res : logging . warning ( "Download failed." ) return False logging . info ( "Start doing after download processing." ) after_res = self . after_download ( ) if not after_res : logging . warning ( "After download process failed." ) return False logging . info ( "Dataset is ready." ) return True