write_yaml#

gammapy.utils.scripts.write_yaml(text, filename, logger=None, sort_keys=False, checksum=False, overwrite=False)[source]#

Write YAML file.

Parameters:
textstr

yaml str

filenamePath

Filename.

loggerLogger, optional

Logger. Default is None.

sort_keysbool, optional

Whether to sort keys. Default is True.

checksumbool, optional

Whether to add checksum keyword. Default is False.

overwritebool, optional

Overwrite existing file. Default is False.