From 6b08d57f2fd28d2a1f7ac78d4d72a87e5733e8a3 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins <jameson.rollins@ligo.org> Date: Fri, 22 May 2020 12:08:46 -0700 Subject: [PATCH] cli: fix errant attempt to show plot when plot saving --- gwinc/__main__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gwinc/__main__.py b/gwinc/__main__.py index 23a21b5e..1afc0b60 100644 --- a/gwinc/__main__.py +++ b/gwinc/__main__.py @@ -138,14 +138,6 @@ def main(): plot_style = getattr(Budget, 'plot_style', {}) traces = None - out_data_files = set() - out_plot_files = set() - if args.save: - for path in args.save: - if os.path.splitext(path)[1] in DATA_SAVE_FORMATS: - out_data_files.add(path) - out_plot_files = set(args.save) - out_data_files - if args.ifo: for paramval in args.ifo: param, val = paramval.split('=', 1) @@ -176,9 +168,17 @@ def main(): print(fmt.format(k, v, ov)) return + out_data_files = set() + out_plot_files = set() + if args.save: + args.plot = False + for path in args.save: + if os.path.splitext(path)[1] in DATA_SAVE_FORMATS: + out_data_files.add(path) + out_plot_files = set(args.save) - out_data_files - if args.plot: - if args.save: + if args.plot or out_plot_files: + if out_plot_files: # FIXME: this silliness seems to be the only way to have # matplotlib usable on systems without a display. There must # be a better way. 'AGG' is a backend that works without -- GitLab