get_zfile#

atomate2.common.files.get_zfile(directory_listing, base_name, allow_missing=False)[source]#

Find gzipped or non-gzipped versions of a file in a directory listing.

Parameters:
  • directory_listing (list of Path) – A list of files in a directory.

  • base_name (str) – The base name of file to find.

  • allow_missing (bool) – Whether to error if no version of the file (gzipped or un-gzipped) can be found.

Returns:

A path to the matched file. If allow_missing=True and the file cannot be found, then None will be returned.

Return type:

Path or None