def test_s2chain_index_n_neq_1_tc_neq_n_neq_ndatabatches(self): PI = PredictionIntervals() ndatabatches = 5 s2chain = np.random.random_sample(size=(100, 3)) ncol = [1, 2, 1] with self.assertRaises(SystemExit, msg='Unrecognized data structure'): PI._analyze_s2chain(ndatabatches=ndatabatches, s2chain=s2chain, ncol=ncol)
def test_s2chain_index_n_eq_1(self): PI = PredictionIntervals() ndatabatches = 1 s2chain = np.random.random_sample(size=(100, 1)) ncol = [1] s2chain_index = PI._analyze_s2chain(ndatabatches=ndatabatches, s2chain=s2chain, ncol=ncol) self.assertTrue(np.array_equal(s2chain_index, np.array([[0, 1]])), msg=str( 'Arrays should match: {}'.format(s2chain_index)))