code: def check_if_needs_modeling(tomodir):
      
      print('check for modeling', tomodir)
      required_files = (
          'config' + os.sep + 'config.dat',
          'rho' + os.sep + 'rho.dat',
          'grid' + os.sep + 'elem.dat',
          'grid' + os.sep + 'elec.dat',
          'exe' + os.sep + 'crmod.cfg',
      )
  
      not_allowed = (
          'mod' + os.sep + 'volt.dat',
      )
      needs_modeling = True
      for filename in not_allowed:
          if os.path.isfile(tomodir + os.sep + filename):
              needs_modeling = False
  
      for filename in required_files:
          full_file = tomodir + os.sep + filename
          if not os.path.isfile(full_file):
              print('does not exist: ', full_file)
              needs_modeling = False
  
      return needs_modeling
docs: check of we need to run CRMod in a given tomodir