scopesim.utils.find_file

Contents

scopesim.utils.find_file#

scopesim.utils.find_file(filename: str, path: Iterable[Path | str] | None = None, silent: bool = False) str | None#

Find a file in search path.

First check whether filename exists as (relative) path. In particular, this finds files that are present in the user’s current working directory. If filename is not found in this way it is looked for in the search path, rc.__search_path__.

Parameters:
  • filename (str) – name of a file to look for

  • path (list) – list of directories to search (default: rc.__search_path__)

  • silent (bool) – if True, remain silent when file is not found

Return type:

Absolute path of the file (str) or None