def test_parser_disp_3d(self): p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20) assert_equal(len(p.disp_3d), 80) for i, d in enumerate(p.disp_3d): assert_equal(d.shape[0], 100) assert_equal(d.shape[1], 80-i) assert_equal(d.shape[2], 3)
def test_get_disps(self): p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20) dt, disp_3d = p.get_disps(np.arange(20, 100, 1), dc) assert_equal(dt, np.arange(20, 100, 1)) assert_equal(len(disp_3d), 80) for i, d in enumerate(disp_3d): assert_equal(d.shape[0], 100) assert_equal(d.shape[1], 80-i) assert_equal(d.shape[2], 3)
def test_smoothed_timesteps_min_dt_zero(self): p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=0) timesteps = p.smoothed_timesteps(100, 30, indices) assert_equal(timesteps, np.arange(1, 100, 1))
def test_smoothed_timesteps_not_enough(self): with self.assertRaises(ValueError): p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=120) p.smoothed_timesteps(100, 20, indices)
def test_parser_delta_t(self): p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20) assert_equal(p.delta_t.size, 80)
def test_parser_init_min_dt(self): p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20) assert_equal(p.min_dt, 20)