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'))
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'))
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)]
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
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) ]
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')
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')
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
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')
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')
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')
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')
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)
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)
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)
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)
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')
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')
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)
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')
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')
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)
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')
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')