def test_calc_credii_with_waitbar(self):
        PI, __, testchain, __, lims, sstype, nsample, iisample, datapred = cc_setup(
        )

        PI._PredictionIntervals__wbarstatus = progress_bar(iters=200)

        ysave = PI._calc_credible_ii(testchain=testchain,
                                     nrow=100,
                                     ncol=1,
                                     waitbar=True,
                                     test=np.array([True, True]),
                                     modelfun=gf.predmodelfun,
                                     datapredii=datapred[0])
        self.assertTrue(isinstance(ysave, np.ndarray), msg='Expect array')
        self.assertEqual(ysave.shape[0], 100, msg='Expect 1st dim = 100')
        self.assertEqual(PI._PredictionIntervals__wbarstatus.percentage(3),
                         1.5,
                         msg='Expect 1.5')
    def test_calc_predii_with_waitbar(self):
        PI, __, testchain, tests2chain, __, sstype, nsample, iisample, datapred = cc_setup(
        )

        PI._PredictionIntervals__wbarstatus = progress_bar(iters=200)

        ysave, osave = PI._calc_credible_and_prediction_ii(
            testchain=testchain,
            tests2chain=tests2chain,
            nrow=100,
            ncol=1,
            waitbar=True,
            sstype=0,
            test=np.array([True, True]),
            modelfun=gf.predmodelfun,
            datapredii=datapred[0])
        self.common_checks(ysave, osave)
        self.assertEqual(PI._PredictionIntervals__wbarstatus.percentage(3),
                         1.5,
                         msg='Expect 1.5')
Esempio n. 3
0
 def test_PB_animation_interval(self):
     PB = pbar.progress_bar(iters=100)
     self.assertEqual(PB.animation_interval,
                      0.5,
                      msg='Animation interval should be 0.5')
Esempio n. 4
0
 def test_ipython_console(self, mock_simple_func):
     mock_simple_func.return_value = True
     PB = pbar.progress_bar(iters=100)
     self.assertEqual(PB.printer, pbar.ipythonprint, msg='ipythonprint')
Esempio n. 5
0
 def test_PB_iteration_assignment(self):
     PB = pbar.progress_bar(iters=100)
     self.assertEqual(PB.iterations,
                      100,
                      msg='Iteration assignment should be 100')