Skip to content

Commit a58c640

Browse files
committed
add return option to yaml merger
1 parent 5e02b5e commit a58c640

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

partis/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4926,7 +4926,7 @@ def merge_csvs(outfname, csv_list, cleanup=False, old_simulation=False):
49264926
return n_event_list, n_seq_list
49274927

49284928
# ----------------------------------------------------------------------------------------
4929-
def merge_yamls(outfname, yaml_list, headers, cleanup=False, use_pyyaml=False, dont_write_git_info=False, remove_duplicates=False, debug=False):
4929+
def merge_yamls(outfname, yaml_list, headers, cleanup=False, use_pyyaml=False, dont_write_git_info=False, remove_duplicates=False, return_merged_objects=False, debug=False):
49304930
from . import glutils
49314931
merged_annotation_list, merged_keys = [], set()
49324932
merged_cpath, merged_glfo = None, None
@@ -4970,7 +4970,10 @@ def merge_yamls(outfname, yaml_list, headers, cleanup=False, use_pyyaml=False, d
49704970
if debug:
49714971
print(' read %d total seqs from %d yaml files' % (sum(n_seq_list), len(yaml_list)))
49724972

4973-
return n_event_list, n_seq_list
4973+
if return_merged_objects:
4974+
return merged_glfo, merged_annotation_list, merged_cpath
4975+
else:
4976+
return n_event_list, n_seq_list
49744977

49754978
# ----------------------------------------------------------------------------------------
49764979
# merge parameter dirs corresponding to <n_subsets> subsets in <basedir> with str <substr>-<isub> (only works with paired dir structure)

0 commit comments

Comments
 (0)