polaris.tasks.ocean.analysis.sim_files.check_files_exist

polaris.tasks.ocean.analysis.sim_files.check_files_exist(sim_files, description, source, template=None, simulation_path=None)[source]

Check that every expanded file exists, reporting the missing years and months rather than a bare list of paths

Parameters:
  • sim_files (list of SimFile) – The files to check, as returned by expand_template()

  • description (str) – A short description of what the files are, used in the error message, e.g. 'monthly-mean'

  • source (str) – A description of where the file-name template came from, so that the error says where to look, e.g. 'the History stream in /path/omega.yml'

  • template (str, optional) – The template the files were expanded from. Given it, the error also says which years the simulation did write, which is usually the answer the reader wants.

  • simulation_path (str, optional) – The directory a relative template is resolved against

Raises:

FileNotFoundError – If any of the files is missing