diff --git a/orbitize/results.py b/orbitize/results.py index ba502574..cecacaff 100644 --- a/orbitize/results.py +++ b/orbitize/results.py @@ -197,7 +197,7 @@ def load_results(self, filename, append=False): iad_data = hf.get("IAD_datafile") if iad_data is not None: - tmpfile = 'thisisprettyhackysorrylmao' + tmpfile = 'tmpfile_OkToDeleteAfterFitFinishes' with open(tmpfile, 'w+') as f: try: for l in np.array(iad_data): @@ -218,8 +218,6 @@ def load_results(self, filename, append=False): renormalize_errors, ) - os.system('rm {}'.format(tmpfile)) - # load Gaia data try: gaia_num = int(hf.attrs['gaia_num']) @@ -232,14 +230,14 @@ def load_results(self, filename, append=False): gaiagost_data = hf.get("Gaia_GOST") if gaiagost_data is not None: - tmpfile = 'thisisprettyhackysorrylmao' + tmpfile = 'tmpfile_OkToDeleteAfterFitFinishes' tmptbl = table.Table(np.array(gaiagost_data)) tmptbl.write(tmpfile, format="ascii", overwrite=True) gaia = orbitize.gaia.HGCALogProb(int(hip_num), hipparcos_IAD, tmpfile) hipparcos_IAD = None # HGCA handles hipparocs, so don't want to pass Hipparcos also into the system - os.system('rm {}'.format(tmpfile)) + else: hipparcos_IAD = None gaia = None diff --git a/tests/test_hipparcos.py b/tests/test_hipparcos.py index cb39df40..08299835 100644 --- a/tests/test_hipparcos.py +++ b/tests/test_hipparcos.py @@ -258,7 +258,10 @@ def test_save_load_2021(): myResults = results.Results() myResults.load_results(filename) - os.system("rm tmp*.hdf5") + filename = "tmp3.hdf5" + myResults.save_results(filename) + + os.system("rm tmp*") if __name__ == "__main__":