def test_averEff(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "aver.prb" options.configfilename = "standard.conf" runMCFRET(options) self.assertAlmostEqual(numpy.loadtxt("effs.txt").mean(), 0.5, delta = 0.05)
def test_stepFunctionBelowReject(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "step.prb" options.configfilename = "stepreject.conf" options.expbfile = "expbursts.bst" runMCFRET(options) self.assertAlmostEqual(numpy.loadtxt("effs.txt").mean(), 0.5, delta = 0.05)
def test_output(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.binaryofile = "binary.pkl" options.burstcompofile = "burstcomp.txt" options.burstsizeofile = "burstsizes.txt" options.decaytimeofile = "decaytimes.txt" options.endtimeofile = "endtimes.txt" options.pbfile = "high.prb" options.configfilename = "standard.conf" runMCFRET(options) self.assertAlmostEqual(numpy.loadtxt("effs.txt").mean(), 1., delta = 0.05)
def test_invalidTrajFormat(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.trajformat = "inv" options.pbfile = "step.prb" options.configfilename = "stepreject.conf" options.expbfile = "expbursts.bst" self.assertRaises(ValueError, runMCFRET, options)
def test_trajFormat(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.trajformat = "dat" options.pbfile = "step.prb" options.configfilename = "stepreject.conf" options.expbfile = "expbursts.bst" runMCFRET(options) self.assertAlmostEqual(numpy.loadtxt("effs.txt").mean(), 0.5, delta = 0.05)
def test_invalidPhotongenerator(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "step.prb" options.configfilename = "invalid_photongenerator.conf" options.expbfile = "expbursts.bst" self.assertRaises(ValueError, runMCFRET, options)
def test_invalidMinMaxStartTraj(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "aver.prb" options.configfilename = "wrongminmaxstart2.conf" options.expbfile = "expbursts.bst" self.assertRaises(ValueError, runMCFRET, options)
def test_cannotAssignClass(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "invalid.prb" options.configfilename = "expbstcorr.conf" options.expbfile = "expbursts.bst" self.assertRaises(ValueError, runMCFRET, options)
def test_profiling(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "high.prb" options.configfilename = "standard.conf" options.prffile = "profile.log" runMCFRET(options) self.assertTrue(os.path.exists("profile.log"))
def test_invalidDir(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "high.prb" options.configfilename = "standard.conf" os.mkdir(os.path.join(self.workdir, "empty")) options.trajdirectory = "empty" self.assertRaises(ValueError, runMCFRET, options)
def test_rejectPhotonTest(self): for i in ("trajectory", "same-species", "all"): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "aver.prb" options.configfilename = "rejecttest-%s.conf" % i options.expbfile = "expbursts.bst" self.assertRaises(ValueError, runMCFRET, options)
def test_expBurstCorrected(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "aver.prb" options.configfilename = "expbstcorr.conf" options.expbfile = "expbursts.bst" runMCFRET(options) self.assertAlmostEqual(numpy.loadtxt("effs.txt").mean(), 0.5, delta = 0.05)
def test_cextensionPhotongenerator(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "step.prb" options.configfilename = "cextension.conf" options.expbfile = "expbursts.bst" try: # from FRETUtils.PhotonGenerator import tryGetCPhoton #@UnusedImport runMCFRET(options) self.assertAlmostEqual(numpy.loadtxt("effs.txt").mean(), 0.5, delta = 0.05) except ImportError: pass
def test_invalidBSCutOff(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "aver.prb" options.configfilename = "invalidbscutoff.conf" self.assertRaises(ValueError, runMCFRET, options)
def test_invalidBurstGenMethod(self): options = FakeOptions() options.efficiencyofile = "effs.txt" options.pbfile = "aver.prb" options.configfilename = "invalidburstacc.conf" self.assertRaises(ValueError, runMCFRET, options)