pynbody.util.open_

Contents

pynbody.util.open_#

pynbody.util.open_(filename: str | Path, *args, **kwargs)[source]#

Open a file, enabling use of gzip decompression

If the filename ends with .gz, the file is assumed to be gzipped. If the file does not exist, but a file with .gz appended does exist, that file is opened instead, on the assumption it is gzipped.

Other arguments are passed through to the standard open function.