示例#1
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     np.random.seed(TEST_SEED)
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000', multi=True)
     self.single_trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000_0.csv')
     self.size_known = json.load(open(FULL_PATH + '/data/effective_size.json', 'r'))
示例#2
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     np.random.seed(TEST_SEED)
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000',
                                 multi=True)
     self.single_trace = Trace.from_csv(FULL_PATH +
                                        '/data/south_mvcm_5000_0.csv')
     self.geweke_known = json.load(open(FULL_PATH + '/data/geweke.json'))
示例#3
0
    def setUp(self):

        self.a = {chr(i+97):list(range(10)) for i in range(5)}

        self.t = Trace(**self.a)
        self.mt = Trace(self.a,self.a,self.a)
        self.real_mt = Trace.from_csv(FULL_PATH + r'/data/south_mvcm_5000', multi=True)
        self.real_singles = [Trace.from_csv(FULL_PATH + r'/data/south_mvcm_5000_{}.csv'
                             .format(i)) for i in range(4)]
示例#4
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     np.random.seed(TEST_SEED)
     test_methods = ['obm', 'bm', 'bartlett', 'hanning', 'tukey']
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000', multi=True)
     self.single_trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000_0.csv')
     self.bm = json.load(open(FULL_PATH + '/data/mcse_bm.json', 'r'))
     self.obm = json.load(open(FULL_PATH + '/data/mcse_obm.json', 'r'))
     self.tukey = json.load(open(FULL_PATH + '/data/mcse_hanning.json', 'r'))
     self.bartlett = json.load(open(FULL_PATH + '/data/mcse_bartlett.json', 'r'))
     self.hanning = self.tukey
示例#5
0
    def setUp(self):

        self.a = {chr(i + 97): list(range(10)) for i in range(5)}

        self.t = Trace(**self.a)
        self.mt = Trace(self.a, self.a, self.a)
        self.real_mt = Trace.from_csv(FULL_PATH + r'/data/south_mvcm_5000',
                                      multi=True)
        self.real_singles = [
            Trace.from_csv(FULL_PATH +
                           r'/data/south_mvcm_5000_{}.csv'.format(i))
            for i in range(4)
        ]
示例#6
0
 def setUp(self):
     super(Test_Lower_SE, self).build_self()
     self.cls = lower.Lower_SE
     del self.inputs["M"]
     self.inputs['n_samples'] = 0
     instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/lower_se.csv')
示例#7
0
 def setUp(self):
     super(Test_Upper_SE, self).build_self()
     self.cls = upper.Upper_SE
     del self.inputs["W"]
     self.inputs['n_samples'] = 0
     instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/upper_se.csv')
示例#8
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     np.random.seed(TEST_SEED)
     test_methods = ['obm', 'bm', 'bartlett', 'hanning', 'tukey']
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000',
                                 multi=True)
     self.single_trace = Trace.from_csv(FULL_PATH +
                                        '/data/south_mvcm_5000_0.csv')
     self.bm = json.load(open(FULL_PATH + '/data/mcse_bm.json', 'r'))
     self.obm = json.load(open(FULL_PATH + '/data/mcse_obm.json', 'r'))
     self.tukey = json.load(open(FULL_PATH + '/data/mcse_hanning.json',
                                 'r'))
     self.bartlett = json.load(
         open(FULL_PATH + '/data/mcse_bartlett.json', 'r'))
     self.hanning = self.tukey
示例#9
0
 def setUp(self):
     super(Test_Upper_SMA, self).build_self()
     self.cls = upper.Upper_SMA
     del self.inputs["W"]
     self.inputs['n_samples'] = 0
     instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/upper_sma.csv')
示例#10
0
 def setUp(self):
     super(Test_Lower_SMA, self).build_self()
     self.cls = lower.Lower_SMA
     del self.inputs["M"]
     self.inputs['n_samples'] = 0
     instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/lower_sma.csv')
示例#11
0
 def setUp(self):
     super(Test_MVCM, self).build_self()
     self.cls = M.MVCM
     del self.inputs['M']
     del self.inputs['W']
     self.inputs['n_samples'] = 0
     self.instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/mvcm.csv')
示例#12
0
 def setUp(self):
     super(Test_MVCM, self).build_self()
     self.cls = M.MVCM
     del self.inputs['M']
     del self.inputs['W']
     self.inputs['n_samples'] = 0
     self.instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/mvcm.csv')
示例#13
0
 def test_mvcm(self):
     instance = self.cls(**self.inputs)
     np.random.seed(TEST_SEED)
     instance.draw()
     other_answers = Trace.from_csv(FULL_PATH + '/data/mvcm.csv')
     strip_out = [col for col in instance.trace.varnames if col not in other_answers.varnames]
     other_answers._assert_allclose(instance.trace.drop(
                                    *strip_out, inplace=False),
                                    rtol=RTOL, atol=ATOL)
示例#14
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     with open(FULL_PATH + '/data/psrf_noburn.json', 'r') as noburn:
         self.noburn = json.load(noburn)
     with open(FULL_PATH + '/data/psrf_brooks.json', 'r') as brooks:
         self.known_brooks = json.load(brooks)
     with open(FULL_PATH + '/data/psrf_gr.json', 'r') as gr:
         self.known_gr = json.load(gr)
     np.random.seed(TEST_SEED)
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000', multi=True)
     self.mockmodel = Hashmap(trace=self.trace)
示例#15
0
 def test_mvcm(self):
     instance = self.cls(**self.inputs)
     np.random.seed(TEST_SEED)
     instance.draw()
     other_answers = Trace.from_csv(FULL_PATH + '/data/mvcm.csv')
     strip_out = [
         col for col in instance.trace.varnames
         if col not in other_answers.varnames
     ]
     other_answers._assert_allclose(instance.trace.drop(*strip_out,
                                                        inplace=False),
                                    rtol=RTOL,
                                    atol=ATOL)
示例#16
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     with open(FULL_PATH + '/data/psrf_noburn.json', 'r') as noburn:
         self.noburn = json.load(noburn)
     with open(FULL_PATH + '/data/psrf_brooks.json', 'r') as brooks:
         self.known_brooks = json.load(brooks)
     with open(FULL_PATH + '/data/psrf_gr.json', 'r') as gr:
         self.known_gr = json.load(gr)
     np.random.seed(TEST_SEED)
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000',
                                 multi=True)
     self.mockmodel = Hashmap(trace=self.trace)
示例#17
0
 def setUp(self):
     super(Test_SESE, self).build_self()
     self.cls = M.SESE
     self.inputs['n_samples'] = 0
     self.instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/sese.csv')
示例#18
0
 def setUp(self):
     super(Test_Generic, self).build_self()
     self.cls = M.Generic
     self.inputs['n_samples'] = 0
     instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/generic.csv')
示例#19
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     np.random.seed(TEST_SEED)
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000',
                                 multi=True)
示例#20
0
 def test_from_csv(self):
     self.t.to_csv('./test_from_csv.csv')
     new_t = Trace.from_csv('./test_from_csv.csv')
     assert self.t == new_t
     os.remove('./test_from_csv.csv')
示例#21
0
 def setUp(self):
     super(Test_SMASE, self).build_self()
     self.cls = M.SMASE
     self.inputs['n_samples'] = 0
     self.instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/smase.csv')
示例#22
0
 def setUp(self):
     data = south()
     data['n_samples'] = 0
     np.random.seed(TEST_SEED)
     self.trace = Trace.from_csv(FULL_PATH + '/data/south_mvcm_5000', multi=True)
示例#23
0
 def setUp(self):
     super(Test_Generic, self).build_self()
     self.cls = M.Generic
     self.inputs['n_samples'] = 0
     instance = self.cls(**self.inputs)
     self.answer_trace = Trace.from_csv(FULL_PATH + '/data/generic.csv')
示例#24
0
 def test_from_csv(self):
     self.t.to_csv('./test_from_csv.csv')
     new_t = Trace.from_csv('./test_from_csv.csv')
     assert self.t == new_t
     os.remove('./test_from_csv.csv')