From 1a984d8a85205a6e7339d5f038cf2d4dcf7a3f21 Mon Sep 17 00:00:00 2001
From: "gregory.ashton" <gregory.ashton@ligo.org>
Date: Tue, 4 Oct 2016 16:01:22 +0200
Subject: [PATCH] Updates tests due ot interface change and fix betas

---
 pyfstat.py | 10 ++++++++--
 tests.py   | 10 +++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/pyfstat.py b/pyfstat.py
index 14abc36..a8b1df8 100755
--- a/pyfstat.py
+++ b/pyfstat.py
@@ -537,7 +537,10 @@ class MCMCSearch(BaseSearchClass):
         self.theta_prior['tend'] = self.tend
         self.unpack_input_theta()
         self.ndim = len(self.theta_keys)
-        self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
+        if self.log10temperature_min:
+            self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
+        else:
+            self.betas = None
 
         if earth_ephem is None:
             self.earth_ephem = self.earth_ephem_default
@@ -1233,7 +1236,10 @@ _        sftfilepath: str
         self.pickle_path = '{}/{}_saved_data.p'.format(self.outdir, self.label)
         self.unpack_input_theta()
         self.ndim = len(self.theta_keys)
-        self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
+        if self.log10temperature_min:
+            self.betas = np.logspace(0, self.log10temperature_min, self.ntemps)
+        else:
+            self.betas = None
         if earth_ephem is None:
             self.earth_ephem = self.earth_ephem_default
         if sun_ephem is None:
diff --git a/tests.py b/tests.py
index b244368..7aa6f44 100644
--- a/tests.py
+++ b/tests.py
@@ -32,16 +32,16 @@ class TestWriter(Test):
 
     def test_makefakedata_usecached(self):
         Writer = pyfstat.Writer(self.label, outdir=outdir)
-        if os.path.isfile(Writer.sft_filepath):
-            os.remove(Writer.sft_filepath)
+        if os.path.isfile(Writer.sftfilepath):
+            os.remove(Writer.sftfilepath)
         Writer.run_makefakedata()
-        time_first = os.path.getmtime(Writer.sft_filepath)
+        time_first = os.path.getmtime(Writer.sftfilepath)
         Writer.run_makefakedata()
-        time_second = os.path.getmtime(Writer.sft_filepath)
+        time_second = os.path.getmtime(Writer.sftfilepath)
         self.assertTrue(time_first == time_second)
         os.system('touch {}'.format(Writer.config_file_name))
         Writer.run_makefakedata()
-        time_third = os.path.getmtime(Writer.sft_filepath)
+        time_third = os.path.getmtime(Writer.sftfilepath)
         self.assertFalse(time_first == time_third)
 
 
-- 
GitLab