Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 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)
Example #9
0
 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"))
Example #10
0
 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)
Example #11
0
 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)
Example #12
0
 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)
Example #13
0
    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
Example #14
0
 def test_invalidBSCutOff(self):
     options = FakeOptions()
     options.efficiencyofile = "effs.txt"
     options.pbfile = "aver.prb"
     options.configfilename = "invalidbscutoff.conf"
     self.assertRaises(ValueError, runMCFRET, options)
Example #15
0
 def test_invalidBurstGenMethod(self):
     options = FakeOptions()
     options.efficiencyofile = "effs.txt"
     options.pbfile = "aver.prb"
     options.configfilename = "invalidburstacc.conf"
     self.assertRaises(ValueError, runMCFRET, options)