original_docstring: Returns true if experiment already has all expected step outputs
docstring: Returns true if experiment already has all expected step outputs
docstring_tokens: Returns true if experiment already has all expected step outputs
code: def has_experiment_outputs(step, experiment, config):
      '''Returns true if experiment already has all expected step outputs'''
  
      # The expected output directories for each step; a step is rerun if any are empty
      experiment_directories = {PREPROC_STEP : ['preproc_dir'],
                                VALIDATE_STEP : ['validate_dir'],
                                TRACKER_STEP : ['track_dir', 'evaluation_dir'],
                                PROJ_TRACKER_STEP : ['track_dir', 'evaluation_dir'],
                                POINT_EVAL_STEP : ['evaluation_dir'],
                                TRACK_EVAL_STEP : ['evaluation_dir'],
                                PREDICT_STEP : ['predict_dir'],
                                FEATURES_STEP : ['features_dir'],
                                ASDP_STEP : ['asdp_dir']}
  
      for directory in experiment_directories[step]:
          exp_dir = get_exp_subdir(directory, experiment, config)
          if not op.isdir(exp_dir) or len(os.listdir(exp_dir)) == 0:
              logging.warning("\tStep {} does not have output {} at {}!".format(step, directory, exp_dir))
              return False
  
      # Additional per step files here
      paths = []
      experiment_name = Path(experiment).name
      if step == POINT_EVAL_STEP:
          paths.append(op.join(get_exp_subdir('evaluation_dir', experiment, config),
                                  experiment_name + '_point_evaluation_report.json'))
      elif step == TRACK_EVAL_STEP:
          paths.append(op.join(get_exp_subdir('evaluation_dir', experiment, config),
                                  experiment_name + '_track_evaluation_report.json'))
      for path in paths:
          if not op.exists(path):
              return False
  
      return True
code_tokens: def has_experiment_outputs ( step , experiment , config ) : experiment_directories = { PREPROC_STEP : [ 'preproc_dir' ] , VALIDATE_STEP : [ 'validate_dir' ] , TRACKER_STEP : [ 'track_dir' , 'evaluation_dir' ] , PROJ_TRACKER_STEP : [ 'track_dir' , 'evaluation_dir' ] , POINT_EVAL_STEP : [ 'evaluation_dir' ] , TRACK_EVAL_STEP : [ 'evaluation_dir' ] , PREDICT_STEP : [ 'predict_dir' ] , FEATURES_STEP : [ 'features_dir' ] , ASDP_STEP : [ 'asdp_dir' ] } for directory in experiment_directories [ step ] : exp_dir = get_exp_subdir ( directory , experiment , config ) if not op . isdir ( exp_dir ) or len ( os . listdir ( exp_dir ) ) == 0 : logging . warning ( "\tStep {} does not have output {} at {}!" . format ( step , directory , exp_dir ) ) return False paths = [ ] experiment_name = Path ( experiment ) . name if step == POINT_EVAL_STEP : paths . append ( op . join ( get_exp_subdir ( 'evaluation_dir' , experiment , config ) , experiment_name + '_point_evaluation_report.json' ) ) elif step == TRACK_EVAL_STEP : paths . append ( op . join ( get_exp_subdir ( 'evaluation_dir' , experiment , config ) , experiment_name + '_track_evaluation_report.json' ) ) for path in paths : if not op . exists ( path ) : return False return True
short_docstring: Returns true if experiment already has all expected step outputs
short_docstring_tokens: Returns true if experiment already has all expected step outputs
comment: '''Returns true if experiment already has all expected step outputs'''$SEP$# The expected output directories for each step; a step is rerun if any are empty$SEP$# Additional per step files here