Skip to content
Snippets Groups Projects
Commit 1a984d8a authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Updates tests due ot interface change and fix betas

parent 12ed7424
No related branches found
No related tags found
No related merge requests found
......@@ -537,7 +537,10 @@ class MCMCSearch(BaseSearchClass):
self.theta_prior['tend'] = self.tend
self.unpack_input_theta()
self.ndim = len(self.theta_keys)
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)
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:
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment