except ImportError: import unittest as ut import spacepy_testing from test_pybats import * from test_time import * from test_empiricals import * from test_toolbox import * from test_omni import * from test_coordinates import * from test_seapy import * from test_poppy import * from test_pycdf import * from test_pycdf_istp import * from test_data_assimilation import * from test_spectrogram import * from test_irbempy import * from test_datamanager import * from test_datamodel import * from test_base import * from test_plot_utils import * from test_rst import * from test_lib import * from test_ae9ap9 import * from test_testing import * # add others here as they are written if __name__ == '__main__': ut.main()
import sys try: import unittest_pretty as ut except ImportError: import unittest as ut from test_pybats import * from test_time import * from test_empiricals import * from test_toolbox import * from test_omni import * from test_coordinates import * from test_seapy import * from test_poppy import * from test_pycdf import * from test_data_assimilation import * from test_spectrogram import * from test_irbempy import * from test_datamanager import * from test_datamodel import * from test_base import * from test_plot_utils import * from test_rst import * from test_lib import * from test_ae9ap9 import * # add others here as they are written if __name__ == '__main__': ut.main()
delta = dt.timedelta(0,60) istart, iend = msm.findContiguousData(acedata['time'], delta, minLength=dt.timedelta(hours=100)) numericDelta = delta.days*86400+delta.seconds results = msm.msm(numericDelta, acedata['time'], pow_in, istart, iend, tau0=2.75*3600) isi = tdelt2hrs(results['tau_valid']) self.assertEqual(2398, len(isi)) msmMean = np.mean(isi) self.assertAlmostEqual(5.2005212677231079, msmMean) msmStd = np.std(isi) self.assertAlmostEqual(4.6785038008585831, msmStd) def test_recurrence_constant(self): '''Test that mean recurrence tends to given recurrence under constant driver Warning: this test is very slow ''' recur = 2.7 seq_len = 10000000 out = msm.msm(60, range(seq_len), [4000]*seq_len, [0], [seq_len-1], tau0 = recur*3600) self.assertAlmostEqual(recur, np.mean(out['tau'])/60, places=4) if __name__ == "__main__": try: utp.main() except: unittest.main()