get_zfile#

atomate2.common.files.get_zfile(directory_listing: list[Path], base_name: str, allow_missing: bool = False) Path | None[source]#

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

Parameters
directory_listinglist of Path

A list of files in a directory.

base_namestr

The base name of file to find.

allow_missingbool

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

Returns
Path or None

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