def test_getPlasmaPauseErrors2(self): '''test more exceptions in getPlasmaPause''' #check for fail on omnivals of wrong type spam = lambda: em.getPlasmaPause(self.ticks, omnivals=['Kp', 2.7]) self.assertRaises(TypeError, spam) #check for fail on omnivals without correct inputs spam1 = lambda: em.getPlasmaPause(self.ticks, omnivals={'Kp': [2.7]*10}) self.assertRaises(KeyError, spam1)
def test_getPlasmaPauseErrors1(self): '''tests for exceptions in getPlasmaPause''' #check for fail on bad LT foo = lambda: em.getPlasmaPause(self.ticks, LT='bad') self.assertRaises(ValueError, foo) #check for fail on bad model bar = lambda: em.getPlasmaPause(self.ticks, model=3) self.assertRaises(ValueError, bar) #check for fail on LT out of legal range spam = lambda: em.getPlasmaPause(self.ticks, LT=25) self.assertRaises(IndexError, spam)
def test_getPlasmaPause_regress4(self): """regression test for plasmapause location""" real_ans = np.array([ 5.2127764 , 4.98740518, 4.75066318, 5.64 , 4.98740518, 4.86 , 4.45707144, 4.45707144, 4.45707144, 4.98740518, 4.45707144]) ans = em.getPlasmaPause(self.ticks, 'RT1970', omnivals=self.omnivals) np.testing.assert_almost_equal(real_ans, ans)
def test_getPlasmaPause_regress3(self): """regression test for plasmapause location""" real_ans = np.array([ 5.2754 , 5.1226 , 4.89340002, 4.89340002, 4.89340002, 5.008 , 4.51140002, 4.51140002, 4.51140002, 4.51140002, 4.51140002]) ans = em.getPlasmaPause(self.ticks, omnivals=self.omnivals) np.testing.assert_almost_equal(real_ans, ans)
def test_getPlasmaPause_regress2(self): """regression test for plasmapause location""" real_ans = np.array([ 5.46199999, 5.27800001, 5.00200002, 5.00200002, 5.00200002, 5.00200002, 4.54200002, 4.54200002, 4.54200002, 4.54200002, 4.54200002]) ans = em.getPlasmaPause(self.ticks, 'CA1992', omnivals=self.omnivals) np.testing.assert_almost_equal(real_ans, ans)
def test_getPlasmaPause_regress1(self): """regression test for plasmapause location""" real_ans = np.array([ 5.07249999, 4.90250001, 4.64750002, 4.64750002, 4.64750002, 4.775 , 4.22250002, 4.22250002, 4.22250002, 4.22250002, 4.22250002]) ans = em.getPlasmaPause(self.ticks, LT=12, omnivals=self.omnivals) np.testing.assert_almost_equal(real_ans, ans)