finish adding ability to have custom auspice config
@@ -566,9 +566,13 @@ def export_title(wildcards):
# TODO: maybe we could replace this with a config entry for full/human-readable build name?
location_name = wildcards.build_name
- if "auspice_config" in config["builds"][location_name]:
from augur.utils import read_config
+ if "auspice_config" in config["builds"][location_name]:
auspice_config = read_config(config["builds"][location_name]["auspice_config"])
+ elif "auspice_config" in config["files"]:
+ auspice_config = read_config(config["files"]["auspice_config"])
+
+ if auspice_config:
if 'title' in auspice_config and auspice_config['title']:
return auspice_config['title']
@@ -604,7 +608,7 @@ rule export:
tree = rules.refine.output.tree,
metadata = _get_metadata_by_wildcards,
node_data = _get_node_data_by_wildcards,
- auspice_config = config["files"]["auspice_config"],
+ auspice_config = lambda w: config["builds"][w.build_name]["auspice_config"] if "auspice_config" in config["builds"][w.build_name] else config["files"]["auspice_config"],
colors = lambda w: config["builds"][w.build_name]["colors"] if "colors" in config["builds"][w.build_name] else ( config["files"]["colors"] if "colors" in config["files"] else rules.colors.output.colors.format(**w) ),
lat_longs = config["files"]["lat_longs"],
description = config["files"]["description"]
