original_docstring: Determine if step needs to be rerun on experiment
docstring: Determine if step needs to be rerun on experiment
docstring_tokens: Determine if step needs to be rerun on experiment
code: def should_run(step, use_preexisting, experiment, config):
      '''Determine if step needs to be rerun on experiment'''
  
      # Run if caching disabled
      if not use_preexisting:
          return True
  
      # Run if outputs don't exists, or were run with a different config
      if not has_experiment_outputs(step, experiment, config):
          return True
  
      # TODO: Run if config doesn't match previous run
  
      # Mapping from each step to the exhaustive list of steps that should trigger a rerun
      experiment_dependencies = {PREPROC_STEP : [],
                                 VALIDATE_STEP : [PREPROC_STEP],
                                 TRACKER_STEP : [VALIDATE_STEP, PREPROC_STEP],
                                 POINT_EVAL_STEP : [TRACKER_STEP],
                                 TRACK_EVAL_STEP : [TRACKER_STEP],
                                 FEATURES_STEP : [TRACKER_STEP]}
  
      # Rerun if any of of the steps depended on by this step were run more recently
      step_ts = get_timestamp(step, experiment, config)
      if not step_ts:
          return True
      for dependency in experiment_dependencies[step]:
          dep_ts = get_timestamp(dependency, experiment, config)
          if not dep_ts or dep_ts > step_ts:
              return True
  
      return False
code_tokens: def should_run ( step , use_preexisting , experiment , config ) : if not use_preexisting : return True if not has_experiment_outputs ( step , experiment , config ) : return True experiment_dependencies = { PREPROC_STEP : [ ] , VALIDATE_STEP : [ PREPROC_STEP ] , TRACKER_STEP : [ VALIDATE_STEP , PREPROC_STEP ] , POINT_EVAL_STEP : [ TRACKER_STEP ] , TRACK_EVAL_STEP : [ TRACKER_STEP ] , FEATURES_STEP : [ TRACKER_STEP ] } step_ts = get_timestamp ( step , experiment , config ) if not step_ts : return True for dependency in experiment_dependencies [ step ] : dep_ts = get_timestamp ( dependency , experiment , config ) if not dep_ts or dep_ts > step_ts : return True return False
short_docstring: Determine if step needs to be rerun on experiment
short_docstring_tokens: Determine if step needs to be rerun on experiment
comment: '''Determine if step needs to be rerun on experiment'''$SEP$# Run if caching disabled$SEP$# Run if outputs don't exists, or were run with a different config$SEP$# TODO: Run if config doesn't match previous run$SEP$# Mapping from each step to the exhaustive list of steps that should trigger a rerun$SEP$# Rerun if any of of the steps depended on by this step were run more recently