From 6a36ec28b5382986d9293283b34551c7660f6760 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Mon, 1 Jun 2020 23:23:15 +0100
Subject: [PATCH] bilby_result: allow output merged file to be gzip or saved as
 a HDF5 file

---
 cli_bilby/bilby_result.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cli_bilby/bilby_result.py b/cli_bilby/bilby_result.py
index d86a8e98d..6cacfb62d 100644
--- a/cli_bilby/bilby_result.py
+++ b/cli_bilby/bilby_result.py
@@ -41,6 +41,10 @@ def setup_command_line_args():
                         help="Convert all results.", default=False)
     parser.add_argument("-m", "--merge", action='store_true',
                         help="Merge the set of runs, output saved using the outdir and label")
+    parser.add_argument("-e", "--extension", type=str, choices=["json", "hdf5"],
+                        default=True, help="Use given extension for the merged output file.")
+    parser.add_argument("-g", "--gzip", action="store_true",
+                        help="Gzip the merged output results file if using JSON format.")
     parser.add_argument("-o", "--outdir", type=str, default=None,
                         help="Output directory.")
     parser.add_argument("-l", "--label", type=str, default=None,
@@ -131,4 +135,6 @@ def main():
             result.label = args.label
         if args.outdir is not None:
             result.outdir = args.outdir
-        result.save_to_file()
+
+        extension = args.extension
+        result.save_to_file(gzip=args.gzip, extension=extension)
-- 
GitLab