From 14ecd45b4593681df15c1f46fcedf17b4898ed7a Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Fri, 28 Jul 2017 13:13:22 +0200
Subject: [PATCH] Fix bug in setting the out file name

If detectors is not specified, det=None, then in the outfile simply use
'NA' to indicate this.
---
 pyfstat/grid_based_searches.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py
index 8ef2ca1..7394100 100644
--- a/pyfstat/grid_based_searches.py
+++ b/pyfstat/grid_based_searches.py
@@ -265,7 +265,10 @@ class GridSearch(BaseSearchClass):
             print('  {}={}'.format(k, v))
 
     def set_out_file(self, extra_label=None):
-        dets = self.detectors.replace(',', '')
+        if self.detectors:
+            dets = self.detectors.replace(',', '')
+        else:
+            dets = 'NA'
         if extra_label:
             self.out_file = '{}/{}_{}_{}_{}.txt'.format(
                 self.outdir, self.label, dets, type(self).__name__,
-- 
GitLab