100 with open(yaml_path,
"r", encoding=
"utf-8")
as cfg_file:
102 config_data = yaml.safe_load(cfg_file)
103 from AnalysisAlgorithmsConfig.ConfigText
import combineConfigFiles
104 combined = combineConfigFiles(
106 os.path.dirname(os.path.dirname(yaml_path)),
107 fragment_key=
"include",
110 with open(
"merged_config.yaml",
"w")
as cfg:
111 cfg.write(yaml.dump(config_data))
112 self.
logger.info(
"Merged included fragments into main config.")
113 return config_data, combined
158 Search for the file up to two levels deep within the first DATAPATH entry.
159 First, check directly under the analysis repository (depth 0).
160 Then, check immediate subdirectories (depth 1), looking for the file inside each.
161 Returns a list of all matches found.
164 analysisRepoPath = os.environ.get(
'DATAPATH',
'').
split(os.pathsep)[0]
166 searchPath = os.path.join(analysisRepoPath, textConfigPath)
167 if os.path.isfile(searchPath):
168 matches.append(searchPath)
171 for subdir
in os.listdir(analysisRepoPath):
172 candidate = os.path.join(
173 analysisRepoPath, subdir, textConfigPath)
174 if os.path.isfile(candidate):
175 matches.append(candidate)