From f06f356bc82aaa3364258981da380b8ff674977f Mon Sep 17 00:00:00 2001 From: sgiardie Date: Thu, 19 Sep 2024 15:04:53 +0100 Subject: [PATCH] switching to cobaya yaml loader --- mflike/foreground.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mflike/foreground.py b/mflike/foreground.py index e499cee..ad3f3f1 100644 --- a/mflike/foreground.py +++ b/mflike/foreground.py @@ -734,14 +734,11 @@ def _bandpass_construction(self, _initialize=False, **params): ## that should be applied to any beam profile ########################################################################### def _read_yaml_file(self, file_path): - import yaml - + + from cobaya.yaml import yaml_load_file + filename = "%s.yaml" % file_path - if not os.path.exists("%s.yaml" % file_path): - raise ValueError("File " + filename + " does not exist!") - - with open(filename, "r") as f: - file = yaml.load(f, Loader=yaml.Loader) + file = yaml_load_file(file_name = filename) return file