From c10c777c135e9b596deed014778d975d6dc0a3a7 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:34:48 -0700 Subject: [PATCH] Disable aliases in dumped config Dumping the config with fully expanded contents is better for debugging and potential reuse. Workaround adapted from https://stackoverflow.com/a/66853182 --- snakemake/config.smk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snakemake/config.smk b/snakemake/config.smk index 15727b0..ada7c1c 100644 --- a/snakemake/config.smk +++ b/snakemake/config.smk @@ -156,6 +156,11 @@ def write_config(path): os.makedirs(os.path.dirname(path), exist_ok=True) with open(path, 'w') as f: - yaml.dump(config, f, sort_keys=False) + yaml.dump(config, f, sort_keys=False, Dumper=NoAliasDumper) print(f"Saved current run config to {path!r}.", file=sys.stderr) + + +class NoAliasDumper(yaml.SafeDumper): + def ignore_aliases(self, data): + return True